//========================================================================================
//  DrawingMode.java
//    en:Drawing mode -- It superimposes a raster of the sprite screen, the text screen and the graphic screen according to the drawing mode.
//    ja:描画モード -- 描画モードに従って1ラスタ分のスプライト画面、テキスト画面およびグラフィック画面を重ね合わせます。
//  Copyright (C) 2003-2025 Makoto Kamada
//
//  This file is part of the XEiJ (X68000 Emulator in Java).
//  You can use, modify and redistribute the XEiJ if the conditions are met.
//  Read the XEiJ License for more details.
//  https://stdkmd.net/xeij/
//========================================================================================

package xeij;

public enum DrawingMode {

  //================================================================================
  //
  //  表示できる画面モード
  //       1. N
  //       2. N_XWC → N
  //       3. N_XWP → N
  //       4. N_XHC → N
  //       5. N_XHCT → N
  //       6. N_XHCG → N
  //       7. N_XHCGT → N
  //       8. N_XHPT → N
  //       9. N_XHPG → N
  //      10. N_XHPGT → N
  //      11. N_A → N
  //      12. S
  //      13. S_XWC → S
  //      14. S_XWP → S
  //      15. S_XHC → S
  //      16. S_XHCT → S
  //      17. S_XHCG → S
  //      18. S_XHCGT → S
  //      19. S_XHPT → S
  //      20. S_XHPG → S
  //      21. S_XHPGT → S
  //      22. S_A → N
  //      23. T
  //      24. T_XWC → T
  //      25. T_XWP → T
  //      26. T_XHC → T
  //      27. T_XHCT → T
  //      28. T_XHCG → T
  //      29. T_XHCGT → T
  //      30. T_XHPT → T
  //      31. T_XHPG → T
  //      32. T_XHPGT → T
  //      33. T_A → N
  //      34. ST
  //      35. ST_XWC → ST
  //      36. ST_XWP → ST
  //      37. ST_XHC → ST
  //      38. ST_XHCT → ST
  //      39. ST_XHCG → ST
  //      40. ST_XHCGT → ST
  //      41. ST_XHPT → ST
  //      42. ST_XHPG → ST
  //      43. ST_XHPGT → ST
  //      44. ST_A → N
  //      45. TS
  //      46. TS_XWC → TS
  //      47. TS_XWP → TS
  //      48. TS_XHC → TS
  //      49. TS_XHCT → TS
  //      50. TS_XHCG → TS
  //      51. TS_XHCGT → TS
  //      52. TS_XHPT → TS
  //      53. TS_XHPG → TS
  //      54. TS_XHPGT → TS
  //      55. TS_A → N
  //      56. E1
  //      57. E1_XWC → E1
  //      58. E1_XWP
  //      59. E1_XHC → E1
  //      60. E1_XHCT
  //      61. E1_XHCG
  //      62. E1_XHCGT
  //      63. E1_XHPT
  //      64. E1_XHPG
  //      65. E1_XHPGT
  //      66. E1_A
  //      67. E2
  //      68. E2_XWC → E2
  //      69. E2_XWP
  //      70. E2_XHC → E2
  //      71. E2_XHCT
  //      72. E2_XHCG
  //      73. E2_XHCGT
  //      74. E2_XHPT
  //      75. E2_XHPG
  //      76. E2_XHPGT
  //      77. E2_A
  //      78. E3
  //      79. E3_XWC → E3
  //      80. E3_XWP
  //      81. E3_XHC → E3
  //      82. E3_XHCT
  //      83. E3_XHCG
  //      84. E3_XHCGT
  //      85. E3_XHPT
  //      86. E3_XHPG
  //      87. E3_XHPGT
  //      88. E3_A
  //      89. E4
  //      90. E4_XWC → E4
  //      91. E4_XWP
  //      92. E4_XHC → E4
  //      93. E4_XHCT
  //      94. E4_XHCG
  //      95. E4_XHCGT
  //      96. E4_XHPT
  //      97. E4_XHPG
  //      98. E4_XHPGT
  //      99. E4_A
  //     100. F1
  //     101. F1_XWC → F1
  //     102. F1_XWP
  //     103. F1_XHC → F1
  //     104. F1_XHCT
  //     105. F1_XHCG
  //     106. F1_XHCGT
  //     107. F1_XHPT
  //     108. F1_XHPG
  //     109. F1_XHPGT
  //     110. F1_A
  //     111. F2
  //     112. F2_XWC → F2
  //     113. F2_XWP
  //     114. F2_XHC → F2
  //     115. F2_XHCT
  //     116. F2_XHCG
  //     117. F2_XHCGT
  //     118. F2_XHPT
  //     119. F2_XHPG
  //     120. F2_XHPGT
  //     121. F2_A
  //     122. G
  //     123. G_XWC → G
  //     124. G_XWP
  //     125. G_XHC → G
  //     126. G_XHCT
  //     127. G_XHPT
  //     128. G_A
  //     129. H
  //     130. H_XWC → H
  //     131. H_XWP
  //     132. H_XHC → H
  //     133. H_XHCT
  //     134. H_XHPT
  //     135. H_A
  //     136. I
  //     137. I_XWC → I
  //     138. I_XWP
  //     139. I_XHC → I
  //     140. I_XHCT
  //     141. I_XHPT
  //     142. I_A
  //     143. J
  //     144. J_XWC → J
  //     145. J_XWP
  //     146. J_XHC → J
  //     147. J_XHCT
  //     148. J_XHPT
  //     149. J_A
  //     150. E1S
  //     151. E1S_XWC
  //     152. E1S_XWP
  //     153. E1S_XHC → E1S
  //     154. E1S_XHCT
  //     155. E1S_XHCG
  //     156. E1S_XHCGT
  //     157. E1S_XHPT
  //     158. E1S_XHPG
  //     159. E1S_XHPGT
  //     160. E1S_A → E1_A
  //     161. E2S
  //     162. E2S_XWC
  //     163. E2S_XWP
  //     164. E2S_XHC → E2S
  //     165. E2S_XHCT
  //     166. E2S_XHCG
  //     167. E2S_XHCGT
  //     168. E2S_XHPT
  //     169. E2S_XHPG
  //     170. E2S_XHPGT
  //     171. E2S_A → E2_A
  //     172. E3S
  //     173. E3S_XWC
  //     174. E3S_XWP
  //     175. E3S_XHC → E3S
  //     176. E3S_XHCT
  //     177. E3S_XHCG
  //     178. E3S_XHCGT
  //     179. E3S_XHPT
  //     180. E3S_XHPG
  //     181. E3S_XHPGT
  //     182. E3S_A → E3_A
  //     183. E4S
  //     184. E4S_XWC
  //     185. E4S_XWP
  //     186. E4S_XHC → E4S
  //     187. E4S_XHCT
  //     188. E4S_XHCG
  //     189. E4S_XHCGT
  //     190. E4S_XHPT
  //     191. E4S_XHPG
  //     192. E4S_XHPGT
  //     193. E4S_A → E4_A
  //     194. F1S
  //     195. F1S_XWC
  //     196. F1S_XWP
  //     197. F1S_XHC → F1S
  //     198. F1S_XHCT
  //     199. F1S_XHCG
  //     200. F1S_XHCGT
  //     201. F1S_XHPT
  //     202. F1S_XHPG
  //     203. F1S_XHPGT
  //     204. F1S_A → F1_A
  //     205. F2S
  //     206. F2S_XWC
  //     207. F2S_XWP
  //     208. F2S_XHC → F2S
  //     209. F2S_XHCT
  //     210. F2S_XHCG
  //     211. F2S_XHCGT
  //     212. F2S_XHPT
  //     213. F2S_XHPG
  //     214. F2S_XHPGT
  //     215. F2S_A → F2_A
  //     216. GS
  //     217. GS_XWC
  //     218. GS_XWP
  //     219. GS_XHC → GS
  //     220. GS_XHCT
  //     221. GS_XHPT
  //     222. GS_A → G_A
  //     223. HS
  //     224. HS_XWC
  //     225. HS_XWP
  //     226. HS_XHC → HS
  //     227. HS_XHCT
  //     228. HS_XHPT
  //     229. HS_A → H_A
  //     230. IS
  //     231. IS_XWC
  //     232. IS_XWP
  //     233. IS_XHC → IS
  //     234. IS_XHCT
  //     235. IS_XHPT
  //     236. IS_A → I_A
  //     237. JS
  //     238. JS_XWC
  //     239. JS_XWP
  //     240. JS_XHC → JS
  //     241. JS_XHCT
  //     242. JS_XHPT
  //     243. JS_A → J_A
  //     244. SE1
  //     245. SE1_XWC
  //     246. SE1_XWP
  //     247. SE1_XHC → SE1
  //     248. SE1_XHCT
  //     249. SE1_XHCG
  //     250. SE1_XHCGT
  //     251. SE1_XHPT
  //     252. SE1_XHPG
  //     253. SE1_XHPGT
  //     254. SE1_A → E1_A
  //     255. SE2
  //     256. SE2_XWC
  //     257. SE2_XWP
  //     258. SE2_XHC → SE2
  //     259. SE2_XHCT
  //     260. SE2_XHCG
  //     261. SE2_XHCGT
  //     262. SE2_XHPT
  //     263. SE2_XHPG
  //     264. SE2_XHPGT
  //     265. SE2_A → E2_A
  //     266. SE3
  //     267. SE3_XWC
  //     268. SE3_XWP
  //     269. SE3_XHC → SE3
  //     270. SE3_XHCT
  //     271. SE3_XHCG
  //     272. SE3_XHCGT
  //     273. SE3_XHPT
  //     274. SE3_XHPG
  //     275. SE3_XHPGT
  //     276. SE3_A → E3_A
  //     277. SE4
  //     278. SE4_XWC
  //     279. SE4_XWP
  //     280. SE4_XHC → SE4
  //     281. SE4_XHCT
  //     282. SE4_XHCG
  //     283. SE4_XHCGT
  //     284. SE4_XHPT
  //     285. SE4_XHPG
  //     286. SE4_XHPGT
  //     287. SE4_A → E4_A
  //     288. SF1
  //     289. SF1_XWC
  //     290. SF1_XWP
  //     291. SF1_XHC → SF1
  //     292. SF1_XHCT
  //     293. SF1_XHCG
  //     294. SF1_XHCGT
  //     295. SF1_XHPT
  //     296. SF1_XHPG
  //     297. SF1_XHPGT
  //     298. SF1_A → F1_A
  //     299. SF2
  //     300. SF2_XWC
  //     301. SF2_XWP
  //     302. SF2_XHC → SF2
  //     303. SF2_XHCT
  //     304. SF2_XHCG
  //     305. SF2_XHCGT
  //     306. SF2_XHPT
  //     307. SF2_XHPG
  //     308. SF2_XHPGT
  //     309. SF2_A → F2_A
  //     310. SG
  //     311. SG_XWC
  //     312. SG_XWP
  //     313. SG_XHC → SG
  //     314. SG_XHCT
  //     315. SG_XHPT
  //     316. SG_A → G_A
  //     317. SH
  //     318. SH_XWC
  //     319. SH_XWP
  //     320. SH_XHC → SH
  //     321. SH_XHCT
  //     322. SH_XHPT
  //     323. SH_A → H_A
  //     324. SI
  //     325. SI_XWC
  //     326. SI_XWP
  //     327. SI_XHC → SI
  //     328. SI_XHCT
  //     329. SI_XHPT
  //     330. SI_A → I_A
  //     331. SJ
  //     332. SJ_XWC
  //     333. SJ_XWP
  //     334. SJ_XHC → SJ
  //     335. SJ_XHCT
  //     336. SJ_XHPT
  //     337. SJ_A → J_A
  //     338. E1T
  //     339. E1T_XWC
  //     340. E1T_XWP
  //     341. E1T_XHC → E1T
  //     342. E1T_XHCT
  //     343. E1T_XHCG
  //     344. E1T_XHCGT
  //     345. E1T_XHPT
  //     346. E1T_XHPG
  //     347. E1T_XHPGT
  //     348. E1T_A → E1_A
  //     349. E2T
  //     350. E2T_XWC
  //     351. E2T_XWP
  //     352. E2T_XHC → E2T
  //     353. E2T_XHCT
  //     354. E2T_XHCG
  //     355. E2T_XHCGT
  //     356. E2T_XHPT
  //     357. E2T_XHPG
  //     358. E2T_XHPGT
  //     359. E2T_A → E2_A
  //     360. E3T
  //     361. E3T_XWC
  //     362. E3T_XWP
  //     363. E3T_XHC → E3T
  //     364. E3T_XHCT
  //     365. E3T_XHCG
  //     366. E3T_XHCGT
  //     367. E3T_XHPT
  //     368. E3T_XHPG
  //     369. E3T_XHPGT
  //     370. E3T_A → E3_A
  //     371. E4T
  //     372. E4T_XWC
  //     373. E4T_XWP
  //     374. E4T_XHC → E4T
  //     375. E4T_XHCT
  //     376. E4T_XHCG
  //     377. E4T_XHCGT
  //     378. E4T_XHPT
  //     379. E4T_XHPG
  //     380. E4T_XHPGT
  //     381. E4T_A → E4_A
  //     382. F1T
  //     383. F1T_XWC
  //     384. F1T_XWP
  //     385. F1T_XHC → F1T
  //     386. F1T_XHCT
  //     387. F1T_XHCG
  //     388. F1T_XHCGT
  //     389. F1T_XHPT
  //     390. F1T_XHPG
  //     391. F1T_XHPGT
  //     392. F1T_A → F1_A
  //     393. F2T
  //     394. F2T_XWC
  //     395. F2T_XWP
  //     396. F2T_XHC → F2T
  //     397. F2T_XHCT
  //     398. F2T_XHCG
  //     399. F2T_XHCGT
  //     400. F2T_XHPT
  //     401. F2T_XHPG
  //     402. F2T_XHPGT
  //     403. F2T_A → F2_A
  //     404. GT
  //     405. GT_XWC
  //     406. GT_XWP
  //     407. GT_XHC → GT
  //     408. GT_XHCT
  //     409. GT_XHPT
  //     410. GT_A → G_A
  //     411. HT
  //     412. HT_XWC
  //     413. HT_XWP
  //     414. HT_XHC → HT
  //     415. HT_XHCT
  //     416. HT_XHPT
  //     417. HT_A → H_A
  //     418. IT
  //     419. IT_XWC
  //     420. IT_XWP
  //     421. IT_XHC → IT
  //     422. IT_XHCT
  //     423. IT_XHPT
  //     424. IT_A → I_A
  //     425. JT
  //     426. JT_XWC
  //     427. JT_XWP
  //     428. JT_XHC → JT
  //     429. JT_XHCT
  //     430. JT_XHPT
  //     431. JT_A → J_A
  //     432. E1t
  //     433. E1t_XWC → E1t
  //     434. E1t_XWP
  //     435. E1t_XHC → E1t
  //     436. E1t_XHCT
  //     437. E1t_XHCG
  //     438. E1t_XHCGT
  //     439. E1t_XHPT
  //     440. E1t_XHPG
  //     441. E1t_XHPGT
  //     442. E1t_A
  //     443. E2t
  //     444. E2t_XWC → E2t
  //     445. E2t_XWP
  //     446. E2t_XHC → E2t
  //     447. E2t_XHCT
  //     448. E2t_XHCG
  //     449. E2t_XHCGT
  //     450. E2t_XHPT
  //     451. E2t_XHPG
  //     452. E2t_XHPGT
  //     453. E2t_A
  //     454. E3t
  //     455. E3t_XWC → E3t
  //     456. E3t_XWP
  //     457. E3t_XHC → E3t
  //     458. E3t_XHCT
  //     459. E3t_XHCG
  //     460. E3t_XHCGT
  //     461. E3t_XHPT
  //     462. E3t_XHPG
  //     463. E3t_XHPGT
  //     464. E3t_A
  //     465. E4t
  //     466. E4t_XWC → E4t
  //     467. E4t_XWP
  //     468. E4t_XHC → E4t
  //     469. E4t_XHCT
  //     470. E4t_XHCG
  //     471. E4t_XHCGT
  //     472. E4t_XHPT
  //     473. E4t_XHPG
  //     474. E4t_XHPGT
  //     475. E4t_A
  //     476. F1t
  //     477. F1t_XWC → F1t
  //     478. F1t_XWP
  //     479. F1t_XHC → F1t
  //     480. F1t_XHCT
  //     481. F1t_XHCG
  //     482. F1t_XHCGT
  //     483. F1t_XHPT
  //     484. F1t_XHPG
  //     485. F1t_XHPGT
  //     486. F1t_A
  //     487. F2t
  //     488. F2t_XWC → F2t
  //     489. F2t_XWP
  //     490. F2t_XHC → F2t
  //     491. F2t_XHCT
  //     492. F2t_XHCG
  //     493. F2t_XHCGT
  //     494. F2t_XHPT
  //     495. F2t_XHPG
  //     496. F2t_XHPGT
  //     497. F2t_A
  //     498. Gt
  //     499. Gt_XWC → Gt
  //     500. Gt_XWP
  //     501. Gt_XHC → Gt
  //     502. Gt_XHCT
  //     503. Gt_XHPT
  //     504. Gt_A
  //     505. Ht
  //     506. Ht_XWC → Ht
  //     507. Ht_XWP
  //     508. Ht_XHC → Ht
  //     509. Ht_XHCT
  //     510. Ht_XHPT
  //     511. Ht_A
  //     512. It
  //     513. It_XWC → It
  //     514. It_XWP
  //     515. It_XHC → It
  //     516. It_XHCT
  //     517. It_XHPT
  //     518. It_A
  //     519. Jt
  //     520. Jt_XWC → Jt
  //     521. Jt_XWP
  //     522. Jt_XHC → Jt
  //     523. Jt_XHCT
  //     524. Jt_XHPT
  //     525. Jt_A
  //     526. TE1
  //     527. TE1_XWC
  //     528. TE1_XWP
  //     529. TE1_XHC → TE1
  //     530. TE1_XHCT
  //     531. TE1_XHCG
  //     532. TE1_XHCGT
  //     533. TE1_XHPT
  //     534. TE1_XHPG
  //     535. TE1_XHPGT
  //     536. TE1_A → E1_A
  //     537. TE2
  //     538. TE2_XWC
  //     539. TE2_XWP
  //     540. TE2_XHC → TE2
  //     541. TE2_XHCT
  //     542. TE2_XHCG
  //     543. TE2_XHCGT
  //     544. TE2_XHPT
  //     545. TE2_XHPG
  //     546. TE2_XHPGT
  //     547. TE2_A → E2_A
  //     548. TE3
  //     549. TE3_XWC
  //     550. TE3_XWP
  //     551. TE3_XHC → TE3
  //     552. TE3_XHCT
  //     553. TE3_XHCG
  //     554. TE3_XHCGT
  //     555. TE3_XHPT
  //     556. TE3_XHPG
  //     557. TE3_XHPGT
  //     558. TE3_A → E3_A
  //     559. TE4
  //     560. TE4_XWC
  //     561. TE4_XWP
  //     562. TE4_XHC → TE4
  //     563. TE4_XHCT
  //     564. TE4_XHCG
  //     565. TE4_XHCGT
  //     566. TE4_XHPT
  //     567. TE4_XHPG
  //     568. TE4_XHPGT
  //     569. TE4_A → E4_A
  //     570. TF1
  //     571. TF1_XWC
  //     572. TF1_XWP
  //     573. TF1_XHC → TF1
  //     574. TF1_XHCT
  //     575. TF1_XHCG
  //     576. TF1_XHCGT
  //     577. TF1_XHPT
  //     578. TF1_XHPG
  //     579. TF1_XHPGT
  //     580. TF1_A → F1_A
  //     581. TF2
  //     582. TF2_XWC
  //     583. TF2_XWP
  //     584. TF2_XHC → TF2
  //     585. TF2_XHCT
  //     586. TF2_XHCG
  //     587. TF2_XHCGT
  //     588. TF2_XHPT
  //     589. TF2_XHPG
  //     590. TF2_XHPGT
  //     591. TF2_A → F2_A
  //     592. TG
  //     593. TG_XWC
  //     594. TG_XWP
  //     595. TG_XHC → TG
  //     596. TG_XHCT
  //     597. TG_XHPT
  //     598. TG_A → G_A
  //     599. TH
  //     600. TH_XWC
  //     601. TH_XWP
  //     602. TH_XHC → TH
  //     603. TH_XHCT
  //     604. TH_XHPT
  //     605. TH_A → H_A
  //     606. TI
  //     607. TI_XWC
  //     608. TI_XWP
  //     609. TI_XHC → TI
  //     610. TI_XHCT
  //     611. TI_XHPT
  //     612. TI_A → I_A
  //     613. TJ
  //     614. TJ_XWC
  //     615. TJ_XWP
  //     616. TJ_XHC → TJ
  //     617. TJ_XHCT
  //     618. TJ_XHPT
  //     619. TJ_A → J_A
  //     620. E1ST
  //     621. E1ST_XWC
  //     622. E1ST_XWP
  //     623. E1ST_XHC → E1ST
  //     624. E1ST_XHCT
  //     625. E1ST_XHCG
  //     626. E1ST_XHCGT
  //     627. E1ST_XHPT
  //     628. E1ST_XHPG
  //     629. E1ST_XHPGT
  //     630. E1ST_A → E1_A
  //     631. E2ST
  //     632. E2ST_XWC
  //     633. E2ST_XWP
  //     634. E2ST_XHC → E2ST
  //     635. E2ST_XHCT
  //     636. E2ST_XHCG
  //     637. E2ST_XHCGT
  //     638. E2ST_XHPT
  //     639. E2ST_XHPG
  //     640. E2ST_XHPGT
  //     641. E2ST_A → E2_A
  //     642. E3ST
  //     643. E3ST_XWC
  //     644. E3ST_XWP
  //     645. E3ST_XHC → E3ST
  //     646. E3ST_XHCT
  //     647. E3ST_XHCG
  //     648. E3ST_XHCGT
  //     649. E3ST_XHPT
  //     650. E3ST_XHPG
  //     651. E3ST_XHPGT
  //     652. E3ST_A → E3_A
  //     653. E4ST
  //     654. E4ST_XWC
  //     655. E4ST_XWP
  //     656. E4ST_XHC → E4ST
  //     657. E4ST_XHCT
  //     658. E4ST_XHCG
  //     659. E4ST_XHCGT
  //     660. E4ST_XHPT
  //     661. E4ST_XHPG
  //     662. E4ST_XHPGT
  //     663. E4ST_A → E4_A
  //     664. F1ST
  //     665. F1ST_XWC
  //     666. F1ST_XWP
  //     667. F1ST_XHC → F1ST
  //     668. F1ST_XHCT
  //     669. F1ST_XHCG
  //     670. F1ST_XHCGT
  //     671. F1ST_XHPT
  //     672. F1ST_XHPG
  //     673. F1ST_XHPGT
  //     674. F1ST_A → F1_A
  //     675. F2ST
  //     676. F2ST_XWC
  //     677. F2ST_XWP
  //     678. F2ST_XHC → F2ST
  //     679. F2ST_XHCT
  //     680. F2ST_XHCG
  //     681. F2ST_XHCGT
  //     682. F2ST_XHPT
  //     683. F2ST_XHPG
  //     684. F2ST_XHPGT
  //     685. F2ST_A → F2_A
  //     686. GST
  //     687. GST_XWC
  //     688. GST_XWP
  //     689. GST_XHC → GST
  //     690. GST_XHCT
  //     691. GST_XHPT
  //     692. GST_A → G_A
  //     693. HST
  //     694. HST_XWC
  //     695. HST_XWP
  //     696. HST_XHC → HST
  //     697. HST_XHCT
  //     698. HST_XHPT
  //     699. HST_A → H_A
  //     700. IST
  //     701. IST_XWC
  //     702. IST_XWP
  //     703. IST_XHC → IST
  //     704. IST_XHCT
  //     705. IST_XHPT
  //     706. IST_A → I_A
  //     707. JST
  //     708. JST_XWC
  //     709. JST_XWP
  //     710. JST_XHC → JST
  //     711. JST_XHCT
  //     712. JST_XHPT
  //     713. JST_A → J_A
  //     714. SE1T
  //     715. SE1T_XWC
  //     716. SE1T_XWP
  //     717. SE1T_XHC → SE1T
  //     718. SE1T_XHCT
  //     719. SE1T_XHCG
  //     720. SE1T_XHCGT
  //     721. SE1T_XHPT
  //     722. SE1T_XHPG
  //     723. SE1T_XHPGT
  //     724. SE1T_A → E1_A
  //     725. SE2T
  //     726. SE2T_XWC
  //     727. SE2T_XWP
  //     728. SE2T_XHC → SE2T
  //     729. SE2T_XHCT
  //     730. SE2T_XHCG
  //     731. SE2T_XHCGT
  //     732. SE2T_XHPT
  //     733. SE2T_XHPG
  //     734. SE2T_XHPGT
  //     735. SE2T_A → E2_A
  //     736. SE3T
  //     737. SE3T_XWC
  //     738. SE3T_XWP
  //     739. SE3T_XHC → SE3T
  //     740. SE3T_XHCT
  //     741. SE3T_XHCG
  //     742. SE3T_XHCGT
  //     743. SE3T_XHPT
  //     744. SE3T_XHPG
  //     745. SE3T_XHPGT
  //     746. SE3T_A → E3_A
  //     747. SE4T
  //     748. SE4T_XWC
  //     749. SE4T_XWP
  //     750. SE4T_XHC → SE4T
  //     751. SE4T_XHCT
  //     752. SE4T_XHCG
  //     753. SE4T_XHCGT
  //     754. SE4T_XHPT
  //     755. SE4T_XHPG
  //     756. SE4T_XHPGT
  //     757. SE4T_A → E4_A
  //     758. SF1T
  //     759. SF1T_XWC
  //     760. SF1T_XWP
  //     761. SF1T_XHC → SF1T
  //     762. SF1T_XHCT
  //     763. SF1T_XHCG
  //     764. SF1T_XHCGT
  //     765. SF1T_XHPT
  //     766. SF1T_XHPG
  //     767. SF1T_XHPGT
  //     768. SF1T_A → F1_A
  //     769. SF2T
  //     770. SF2T_XWC
  //     771. SF2T_XWP
  //     772. SF2T_XHC → SF2T
  //     773. SF2T_XHCT
  //     774. SF2T_XHCG
  //     775. SF2T_XHCGT
  //     776. SF2T_XHPT
  //     777. SF2T_XHPG
  //     778. SF2T_XHPGT
  //     779. SF2T_A → F2_A
  //     780. SGT
  //     781. SGT_XWC
  //     782. SGT_XWP
  //     783. SGT_XHC → SGT
  //     784. SGT_XHCT
  //     785. SGT_XHPT
  //     786. SGT_A → G_A
  //     787. SHT
  //     788. SHT_XWC
  //     789. SHT_XWP
  //     790. SHT_XHC → SHT
  //     791. SHT_XHCT
  //     792. SHT_XHPT
  //     793. SHT_A → H_A
  //     794. SIT
  //     795. SIT_XWC
  //     796. SIT_XWP
  //     797. SIT_XHC → SIT
  //     798. SIT_XHCT
  //     799. SIT_XHPT
  //     800. SIT_A → I_A
  //     801. SJT
  //     802. SJT_XWC
  //     803. SJT_XWP
  //     804. SJT_XHC → SJT
  //     805. SJT_XHCT
  //     806. SJT_XHPT
  //     807. SJT_A → J_A
  //     808. SE1t
  //     809. SE1t_XWC
  //     810. SE1t_XWP
  //     811. SE1t_XHC → SE1t
  //     812. SE1t_XHCT
  //     813. SE1t_XHCG
  //     814. SE1t_XHCGT
  //     815. SE1t_XHPT
  //     816. SE1t_XHPG
  //     817. SE1t_XHPGT
  //     818. SE1t_A → E1_A
  //     819. SE2t
  //     820. SE2t_XWC
  //     821. SE2t_XWP
  //     822. SE2t_XHC → SE2t
  //     823. SE2t_XHCT
  //     824. SE2t_XHCG
  //     825. SE2t_XHCGT
  //     826. SE2t_XHPT
  //     827. SE2t_XHPG
  //     828. SE2t_XHPGT
  //     829. SE2t_A → E2_A
  //     830. SE3t
  //     831. SE3t_XWC
  //     832. SE3t_XWP
  //     833. SE3t_XHC → SE3t
  //     834. SE3t_XHCT
  //     835. SE3t_XHCG
  //     836. SE3t_XHCGT
  //     837. SE3t_XHPT
  //     838. SE3t_XHPG
  //     839. SE3t_XHPGT
  //     840. SE3t_A → E3_A
  //     841. SE4t
  //     842. SE4t_XWC
  //     843. SE4t_XWP
  //     844. SE4t_XHC → SE4t
  //     845. SE4t_XHCT
  //     846. SE4t_XHCG
  //     847. SE4t_XHCGT
  //     848. SE4t_XHPT
  //     849. SE4t_XHPG
  //     850. SE4t_XHPGT
  //     851. SE4t_A → E4_A
  //     852. SF1t
  //     853. SF1t_XWC
  //     854. SF1t_XWP
  //     855. SF1t_XHC → SF1t
  //     856. SF1t_XHCT
  //     857. SF1t_XHCG
  //     858. SF1t_XHCGT
  //     859. SF1t_XHPT
  //     860. SF1t_XHPG
  //     861. SF1t_XHPGT
  //     862. SF1t_A → F1_A
  //     863. SF2t
  //     864. SF2t_XWC
  //     865. SF2t_XWP
  //     866. SF2t_XHC → SF2t
  //     867. SF2t_XHCT
  //     868. SF2t_XHCG
  //     869. SF2t_XHCGT
  //     870. SF2t_XHPT
  //     871. SF2t_XHPG
  //     872. SF2t_XHPGT
  //     873. SF2t_A → F2_A
  //     874. SGt
  //     875. SGt_XWC
  //     876. SGt_XWP
  //     877. SGt_XHC → SGt
  //     878. SGt_XHCT
  //     879. SGt_XHPT
  //     880. SGt_A → G_A
  //     881. SHt
  //     882. SHt_XWC
  //     883. SHt_XWP
  //     884. SHt_XHC → SHt
  //     885. SHt_XHCT
  //     886. SHt_XHPT
  //     887. SHt_A → H_A
  //     888. SIt
  //     889. SIt_XWC
  //     890. SIt_XWP
  //     891. SIt_XHC → SIt
  //     892. SIt_XHCT
  //     893. SIt_XHPT
  //     894. SIt_A → I_A
  //     895. SJt
  //     896. SJt_XWC
  //     897. SJt_XWP
  //     898. SJt_XHC → SJt
  //     899. SJt_XHCT
  //     900. SJt_XHPT
  //     901. SJt_A → J_A
  //     902. STE1
  //     903. STE1_XWC
  //     904. STE1_XWP
  //     905. STE1_XHC → STE1
  //     906. STE1_XHCT
  //     907. STE1_XHCG
  //     908. STE1_XHCGT
  //     909. STE1_XHPT
  //     910. STE1_XHPG
  //     911. STE1_XHPGT
  //     912. STE1_A → E1_A
  //     913. STE2
  //     914. STE2_XWC
  //     915. STE2_XWP
  //     916. STE2_XHC → STE2
  //     917. STE2_XHCT
  //     918. STE2_XHCG
  //     919. STE2_XHCGT
  //     920. STE2_XHPT
  //     921. STE2_XHPG
  //     922. STE2_XHPGT
  //     923. STE2_A → E2_A
  //     924. STE3
  //     925. STE3_XWC
  //     926. STE3_XWP
  //     927. STE3_XHC → STE3
  //     928. STE3_XHCT
  //     929. STE3_XHCG
  //     930. STE3_XHCGT
  //     931. STE3_XHPT
  //     932. STE3_XHPG
  //     933. STE3_XHPGT
  //     934. STE3_A → E3_A
  //     935. STE4
  //     936. STE4_XWC
  //     937. STE4_XWP
  //     938. STE4_XHC → STE4
  //     939. STE4_XHCT
  //     940. STE4_XHCG
  //     941. STE4_XHCGT
  //     942. STE4_XHPT
  //     943. STE4_XHPG
  //     944. STE4_XHPGT
  //     945. STE4_A → E4_A
  //     946. STF1
  //     947. STF1_XWC
  //     948. STF1_XWP
  //     949. STF1_XHC → STF1
  //     950. STF1_XHCT
  //     951. STF1_XHCG
  //     952. STF1_XHCGT
  //     953. STF1_XHPT
  //     954. STF1_XHPG
  //     955. STF1_XHPGT
  //     956. STF1_A → F1_A
  //     957. STF2
  //     958. STF2_XWC
  //     959. STF2_XWP
  //     960. STF2_XHC → STF2
  //     961. STF2_XHCT
  //     962. STF2_XHCG
  //     963. STF2_XHCGT
  //     964. STF2_XHPT
  //     965. STF2_XHPG
  //     966. STF2_XHPGT
  //     967. STF2_A → F2_A
  //     968. STG
  //     969. STG_XWC
  //     970. STG_XWP
  //     971. STG_XHC → STG
  //     972. STG_XHCT
  //     973. STG_XHPT
  //     974. STG_A → G_A
  //     975. STH
  //     976. STH_XWC
  //     977. STH_XWP
  //     978. STH_XHC → STH
  //     979. STH_XHCT
  //     980. STH_XHPT
  //     981. STH_A → H_A
  //     982. STI
  //     983. STI_XWC
  //     984. STI_XWP
  //     985. STI_XHC → STI
  //     986. STI_XHCT
  //     987. STI_XHPT
  //     988. STI_A → I_A
  //     989. STJ
  //     990. STJ_XWC
  //     991. STJ_XWP
  //     992. STJ_XHC → STJ
  //     993. STJ_XHCT
  //     994. STJ_XHPT
  //     995. STJ_A → J_A
  //     996. E1TS
  //     997. E1TS_XWC
  //     998. E1TS_XWP
  //     999. E1TS_XHC → E1TS
  //    1000. E1TS_XHCT
  //    1001. E1TS_XHCG
  //    1002. E1TS_XHCGT
  //    1003. E1TS_XHPT
  //    1004. E1TS_XHPG
  //    1005. E1TS_XHPGT
  //    1006. E1TS_A → E1_A
  //    1007. E2TS
  //    1008. E2TS_XWC
  //    1009. E2TS_XWP
  //    1010. E2TS_XHC → E2TS
  //    1011. E2TS_XHCT
  //    1012. E2TS_XHCG
  //    1013. E2TS_XHCGT
  //    1014. E2TS_XHPT
  //    1015. E2TS_XHPG
  //    1016. E2TS_XHPGT
  //    1017. E2TS_A → E2_A
  //    1018. E3TS
  //    1019. E3TS_XWC
  //    1020. E3TS_XWP
  //    1021. E3TS_XHC → E3TS
  //    1022. E3TS_XHCT
  //    1023. E3TS_XHCG
  //    1024. E3TS_XHCGT
  //    1025. E3TS_XHPT
  //    1026. E3TS_XHPG
  //    1027. E3TS_XHPGT
  //    1028. E3TS_A → E3_A
  //    1029. E4TS
  //    1030. E4TS_XWC
  //    1031. E4TS_XWP
  //    1032. E4TS_XHC → E4TS
  //    1033. E4TS_XHCT
  //    1034. E4TS_XHCG
  //    1035. E4TS_XHCGT
  //    1036. E4TS_XHPT
  //    1037. E4TS_XHPG
  //    1038. E4TS_XHPGT
  //    1039. E4TS_A → E4_A
  //    1040. F1TS
  //    1041. F1TS_XWC
  //    1042. F1TS_XWP
  //    1043. F1TS_XHC → F1TS
  //    1044. F1TS_XHCT
  //    1045. F1TS_XHCG
  //    1046. F1TS_XHCGT
  //    1047. F1TS_XHPT
  //    1048. F1TS_XHPG
  //    1049. F1TS_XHPGT
  //    1050. F1TS_A → F1_A
  //    1051. F2TS
  //    1052. F2TS_XWC
  //    1053. F2TS_XWP
  //    1054. F2TS_XHC → F2TS
  //    1055. F2TS_XHCT
  //    1056. F2TS_XHCG
  //    1057. F2TS_XHCGT
  //    1058. F2TS_XHPT
  //    1059. F2TS_XHPG
  //    1060. F2TS_XHPGT
  //    1061. F2TS_A → F2_A
  //    1062. GTS
  //    1063. GTS_XWC
  //    1064. GTS_XWP
  //    1065. GTS_XHC → GTS
  //    1066. GTS_XHCT
  //    1067. GTS_XHPT
  //    1068. GTS_A → G_A
  //    1069. HTS
  //    1070. HTS_XWC
  //    1071. HTS_XWP
  //    1072. HTS_XHC → HTS
  //    1073. HTS_XHCT
  //    1074. HTS_XHPT
  //    1075. HTS_A → H_A
  //    1076. ITS
  //    1077. ITS_XWC
  //    1078. ITS_XWP
  //    1079. ITS_XHC → ITS
  //    1080. ITS_XHCT
  //    1081. ITS_XHPT
  //    1082. ITS_A → I_A
  //    1083. JTS
  //    1084. JTS_XWC
  //    1085. JTS_XWP
  //    1086. JTS_XHC → JTS
  //    1087. JTS_XHCT
  //    1088. JTS_XHPT
  //    1089. JTS_A → J_A
  //    1090. TE1S
  //    1091. TE1S_XWC
  //    1092. TE1S_XWP
  //    1093. TE1S_XHC → TE1S
  //    1094. TE1S_XHCT
  //    1095. TE1S_XHCG
  //    1096. TE1S_XHCGT
  //    1097. TE1S_XHPT
  //    1098. TE1S_XHPG
  //    1099. TE1S_XHPGT
  //    1100. TE1S_A → E1_A
  //    1101. TE2S
  //    1102. TE2S_XWC
  //    1103. TE2S_XWP
  //    1104. TE2S_XHC → TE2S
  //    1105. TE2S_XHCT
  //    1106. TE2S_XHCG
  //    1107. TE2S_XHCGT
  //    1108. TE2S_XHPT
  //    1109. TE2S_XHPG
  //    1110. TE2S_XHPGT
  //    1111. TE2S_A → E2_A
  //    1112. TE3S
  //    1113. TE3S_XWC
  //    1114. TE3S_XWP
  //    1115. TE3S_XHC → TE3S
  //    1116. TE3S_XHCT
  //    1117. TE3S_XHCG
  //    1118. TE3S_XHCGT
  //    1119. TE3S_XHPT
  //    1120. TE3S_XHPG
  //    1121. TE3S_XHPGT
  //    1122. TE3S_A → E3_A
  //    1123. TE4S
  //    1124. TE4S_XWC
  //    1125. TE4S_XWP
  //    1126. TE4S_XHC → TE4S
  //    1127. TE4S_XHCT
  //    1128. TE4S_XHCG
  //    1129. TE4S_XHCGT
  //    1130. TE4S_XHPT
  //    1131. TE4S_XHPG
  //    1132. TE4S_XHPGT
  //    1133. TE4S_A → E4_A
  //    1134. TF1S
  //    1135. TF1S_XWC
  //    1136. TF1S_XWP
  //    1137. TF1S_XHC → TF1S
  //    1138. TF1S_XHCT
  //    1139. TF1S_XHCG
  //    1140. TF1S_XHCGT
  //    1141. TF1S_XHPT
  //    1142. TF1S_XHPG
  //    1143. TF1S_XHPGT
  //    1144. TF1S_A → F1_A
  //    1145. TF2S
  //    1146. TF2S_XWC
  //    1147. TF2S_XWP
  //    1148. TF2S_XHC → TF2S
  //    1149. TF2S_XHCT
  //    1150. TF2S_XHCG
  //    1151. TF2S_XHCGT
  //    1152. TF2S_XHPT
  //    1153. TF2S_XHPG
  //    1154. TF2S_XHPGT
  //    1155. TF2S_A → F2_A
  //    1156. TGS
  //    1157. TGS_XWC
  //    1158. TGS_XWP
  //    1159. TGS_XHC → TGS
  //    1160. TGS_XHCT
  //    1161. TGS_XHPT
  //    1162. TGS_A → G_A
  //    1163. THS
  //    1164. THS_XWC
  //    1165. THS_XWP
  //    1166. THS_XHC → THS
  //    1167. THS_XHCT
  //    1168. THS_XHPT
  //    1169. THS_A → H_A
  //    1170. TIS
  //    1171. TIS_XWC
  //    1172. TIS_XWP
  //    1173. TIS_XHC → TIS
  //    1174. TIS_XHCT
  //    1175. TIS_XHPT
  //    1176. TIS_A → I_A
  //    1177. TJS
  //    1178. TJS_XWC
  //    1179. TJS_XWP
  //    1180. TJS_XHC → TJS
  //    1181. TJS_XHCT
  //    1182. TJS_XHPT
  //    1183. TJS_A → J_A
  //    1184. TE1s
  //    1185. TE1s_XWC
  //    1186. TE1s_XWP
  //    1187. TE1s_XHC → TE1s
  //    1188. TE1s_XHCT
  //    1189. TE1s_XHCG
  //    1190. TE1s_XHCGT
  //    1191. TE1s_XHPT
  //    1192. TE1s_XHPG
  //    1193. TE1s_XHPGT
  //    1194. TE1s_A → E1_A
  //    1195. TE2s
  //    1196. TE2s_XWC
  //    1197. TE2s_XWP
  //    1198. TE2s_XHC → TE2s
  //    1199. TE2s_XHCT
  //    1200. TE2s_XHCG
  //    1201. TE2s_XHCGT
  //    1202. TE2s_XHPT
  //    1203. TE2s_XHPG
  //    1204. TE2s_XHPGT
  //    1205. TE2s_A → E2_A
  //    1206. TE3s
  //    1207. TE3s_XWC
  //    1208. TE3s_XWP
  //    1209. TE3s_XHC → TE3s
  //    1210. TE3s_XHCT
  //    1211. TE3s_XHCG
  //    1212. TE3s_XHCGT
  //    1213. TE3s_XHPT
  //    1214. TE3s_XHPG
  //    1215. TE3s_XHPGT
  //    1216. TE3s_A → E3_A
  //    1217. TE4s
  //    1218. TE4s_XWC
  //    1219. TE4s_XWP
  //    1220. TE4s_XHC → TE4s
  //    1221. TE4s_XHCT
  //    1222. TE4s_XHCG
  //    1223. TE4s_XHCGT
  //    1224. TE4s_XHPT
  //    1225. TE4s_XHPG
  //    1226. TE4s_XHPGT
  //    1227. TE4s_A → E4_A
  //    1228. TF1s
  //    1229. TF1s_XWC
  //    1230. TF1s_XWP
  //    1231. TF1s_XHC → TF1s
  //    1232. TF1s_XHCT
  //    1233. TF1s_XHCG
  //    1234. TF1s_XHCGT
  //    1235. TF1s_XHPT
  //    1236. TF1s_XHPG
  //    1237. TF1s_XHPGT
  //    1238. TF1s_A → F1_A
  //    1239. TF2s
  //    1240. TF2s_XWC
  //    1241. TF2s_XWP
  //    1242. TF2s_XHC → TF2s
  //    1243. TF2s_XHCT
  //    1244. TF2s_XHCG
  //    1245. TF2s_XHCGT
  //    1246. TF2s_XHPT
  //    1247. TF2s_XHPG
  //    1248. TF2s_XHPGT
  //    1249. TF2s_A → F2_A
  //    1250. TGs
  //    1251. TGs_XWC
  //    1252. TGs_XWP
  //    1253. TGs_XHC → TGs
  //    1254. TGs_XHCT
  //    1255. TGs_XHPT
  //    1256. TGs_A → G_A
  //    1257. THs
  //    1258. THs_XWC
  //    1259. THs_XWP
  //    1260. THs_XHC → THs
  //    1261. THs_XHCT
  //    1262. THs_XHPT
  //    1263. THs_A → H_A
  //    1264. TIs
  //    1265. TIs_XWC
  //    1266. TIs_XWP
  //    1267. TIs_XHC → TIs
  //    1268. TIs_XHCT
  //    1269. TIs_XHPT
  //    1270. TIs_A → I_A
  //    1271. TJs
  //    1272. TJs_XWC
  //    1273. TJs_XWP
  //    1274. TJs_XHC → TJs
  //    1275. TJs_XHCT
  //    1276. TJs_XHPT
  //    1277. TJs_A → J_A
  //    1278. TSE1
  //    1279. TSE1_XWC
  //    1280. TSE1_XWP
  //    1281. TSE1_XHC → TSE1
  //    1282. TSE1_XHCT
  //    1283. TSE1_XHCG
  //    1284. TSE1_XHCGT
  //    1285. TSE1_XHPT
  //    1286. TSE1_XHPG
  //    1287. TSE1_XHPGT
  //    1288. TSE1_A → E1_A
  //    1289. TSE2
  //    1290. TSE2_XWC
  //    1291. TSE2_XWP
  //    1292. TSE2_XHC → TSE2
  //    1293. TSE2_XHCT
  //    1294. TSE2_XHCG
  //    1295. TSE2_XHCGT
  //    1296. TSE2_XHPT
  //    1297. TSE2_XHPG
  //    1298. TSE2_XHPGT
  //    1299. TSE2_A → E2_A
  //    1300. TSE3
  //    1301. TSE3_XWC
  //    1302. TSE3_XWP
  //    1303. TSE3_XHC → TSE3
  //    1304. TSE3_XHCT
  //    1305. TSE3_XHCG
  //    1306. TSE3_XHCGT
  //    1307. TSE3_XHPT
  //    1308. TSE3_XHPG
  //    1309. TSE3_XHPGT
  //    1310. TSE3_A → E3_A
  //    1311. TSE4
  //    1312. TSE4_XWC
  //    1313. TSE4_XWP
  //    1314. TSE4_XHC → TSE4
  //    1315. TSE4_XHCT
  //    1316. TSE4_XHCG
  //    1317. TSE4_XHCGT
  //    1318. TSE4_XHPT
  //    1319. TSE4_XHPG
  //    1320. TSE4_XHPGT
  //    1321. TSE4_A → E4_A
  //    1322. TSF1
  //    1323. TSF1_XWC
  //    1324. TSF1_XWP
  //    1325. TSF1_XHC → TSF1
  //    1326. TSF1_XHCT
  //    1327. TSF1_XHCG
  //    1328. TSF1_XHCGT
  //    1329. TSF1_XHPT
  //    1330. TSF1_XHPG
  //    1331. TSF1_XHPGT
  //    1332. TSF1_A → F1_A
  //    1333. TSF2
  //    1334. TSF2_XWC
  //    1335. TSF2_XWP
  //    1336. TSF2_XHC → TSF2
  //    1337. TSF2_XHCT
  //    1338. TSF2_XHCG
  //    1339. TSF2_XHCGT
  //    1340. TSF2_XHPT
  //    1341. TSF2_XHPG
  //    1342. TSF2_XHPGT
  //    1343. TSF2_A → F2_A
  //    1344. TSG
  //    1345. TSG_XWC
  //    1346. TSG_XWP
  //    1347. TSG_XHC → TSG
  //    1348. TSG_XHCT
  //    1349. TSG_XHPT
  //    1350. TSG_A → G_A
  //    1351. TSH
  //    1352. TSH_XWC
  //    1353. TSH_XWP
  //    1354. TSH_XHC → TSH
  //    1355. TSH_XHCT
  //    1356. TSH_XHPT
  //    1357. TSH_A → H_A
  //    1358. TSI
  //    1359. TSI_XWC
  //    1360. TSI_XWP
  //    1361. TSI_XHC → TSI
  //    1362. TSI_XHCT
  //    1363. TSI_XHPT
  //    1364. TSI_A → I_A
  //    1365. TSJ
  //    1366. TSJ_XWC
  //    1367. TSJ_XWP
  //    1368. TSJ_XHC → TSJ
  //    1369. TSJ_XHCT
  //    1370. TSJ_XHPT
  //    1371. TSJ_A → J_A

  //================================================================================
  //N ($0000,$06xx,$0000)
  //  概要
  //    N  表示画面なし
  //    拡張なし
  //  手順
  //    カラー0(黒)
  //  中間コード1
  //    0
  //  中間コード2
  //    0
  //  中間コード3
  //    0
  //  中間コード4
  //    0
  //  中間コード5
  //    0
  //  中間コード6
  //    cto(0)
  N {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        da += half;
      }
      while (da < db) {
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[0]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[0]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[0]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[0]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[0]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[0]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[0]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[0]);
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //N

  //================================================================================
  //XN
  //  概要
  //    N  表示画面なし
  //    拡張あり
  XN {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //N_XWC
      case 0b00010001:  //N_XWC
      case 0b00010010:  //N_XWC
      case 0b00010011:  //N_XWC
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //N_XWP
      case 0b00010101:  //N_XWP
      case 0b00010110:  //N_XWP
      case 0b00010111:  //N_XWP
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //N_XHC
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //N_XHCT
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //N_XHCG
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //N_XHCGT
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //N_XHPT
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //N_XHPG
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //N_XHPGT
        N.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //N_A
      case 0b01000001:  //N_A
      case 0b01000010:  //N_A
      case 0b01000011:  //N_A
      case 0b01000100:  //N_A
      case 0b01000101:  //N_A
      case 0b01000110:  //N_A
      case 0b01000111:  //N_A
      case 0b01001000:  //N_A
      case 0b01001001:  //N_A
      case 0b01001010:  //N_A
      case 0b01001011:  //N_A
      case 0b01001100:  //N_A
      case 0b01001101:  //N_A
      case 0b01001110:  //N_A
      case 0b01001111:  //N_A
      case 0b01010000:  //N_A
      case 0b01010001:  //N_A
      case 0b01010010:  //N_A
      case 0b01010011:  //N_A
      case 0b01010100:  //N_A
      case 0b01010101:  //N_A
      case 0b01010110:  //N_A
      case 0b01010111:  //N_A
      case 0b01011000:  //N_A
      case 0b01011001:  //N_A
      case 0b01011010:  //N_A
      case 0b01011011:  //N_A
      case 0b01011100:  //N_A
      case 0b01011101:  //N_A
      case 0b01011110:  //N_A
      case 0b01011111:  //N_A
        N.drawRaster (src, dst, rh);
        break;
      default:
        N.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XN);
      }  //switch
    }  //drawRaster
  },  //XN

  //================================================================================
  //S ($0000,$06xx,$0040)
  //  概要
  //    S  スプライト
  //    拡張なし
  //  手順
  //    スプライトカラー(0は黒)
  //  中間コード1
  //    spc(spp())
  //  中間コード2
  //    spc(spp())
  //  中間コード3
  //    spc(spp())
  //  中間コード4
  //    spc(spp())
  //  中間コード5
  //    spc(spp())
  //  中間コード6
  //    spo(spp())
  S {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      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;
        da += half;
      }
      while (da < db) {
        XEiJ.pnlBM[da] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
        sx += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //S

  //================================================================================
  //XS
  //  概要
  //    S  スプライト
  //    拡張あり
  XS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //S_XWC
      case 0b00010001:  //S_XWC
      case 0b00010010:  //S_XWC
      case 0b00010011:  //S_XWC
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //S_XWP
      case 0b00010101:  //S_XWP
      case 0b00010110:  //S_XWP
      case 0b00010111:  //S_XWP
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //S_XHC
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //S_XHCT
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //S_XHCG
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //S_XHCGT
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //S_XHPT
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //S_XHPG
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //S_XHPGT
        S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //S_A
      case 0b01000001:  //S_A
      case 0b01000010:  //S_A
      case 0b01000011:  //S_A
      case 0b01000100:  //S_A
      case 0b01000101:  //S_A
      case 0b01000110:  //S_A
      case 0b01000111:  //S_A
      case 0b01001000:  //S_A
      case 0b01001001:  //S_A
      case 0b01001010:  //S_A
      case 0b01001011:  //S_A
      case 0b01001100:  //S_A
      case 0b01001101:  //S_A
      case 0b01001110:  //S_A
      case 0b01001111:  //S_A
      case 0b01010000:  //S_A
      case 0b01010001:  //S_A
      case 0b01010010:  //S_A
      case 0b01010011:  //S_A
      case 0b01010100:  //S_A
      case 0b01010101:  //S_A
      case 0b01010110:  //S_A
      case 0b01010111:  //S_A
      case 0b01011000:  //S_A
      case 0b01011001:  //S_A
      case 0b01011010:  //S_A
      case 0b01011011:  //S_A
      case 0b01011100:  //S_A
      case 0b01011101:  //S_A
      case 0b01011110:  //S_A
      case 0b01011111:  //S_A
        N.drawRaster (src, dst, rh);
        break;
      default:
        S.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XS);
      }  //switch
    }  //drawRaster
  },  //XS

  //================================================================================
  //T ($0000,$06xx,$0020)
  //  概要
  //    T  テキスト
  //    拡張なし
  //  手順
  //    テキストカラー(0は黒)
  //  中間コード1
  //    tpc(txp())
  //  中間コード2
  //    tpc(txp())
  //  中間コード3
  //    tpc(txp())
  //  中間コード4
  //    tpc(txp())
  //  中間コード5
  //    tpc(txp())
  //  中間コード6
  //    tpo(txp())
  T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          XEiJ.pnlBM[da] = (VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPal32TS[tp & 15]);
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          XEiJ.pnlBM[da] = (VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPal32TS[tp & 15]);
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //T

  //================================================================================
  //XT
  //  概要
  //    T  テキスト
  //    拡張あり
  XT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //T_XWC
      case 0b00010001:  //T_XWC
      case 0b00010010:  //T_XWC
      case 0b00010011:  //T_XWC
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //T_XWP
      case 0b00010101:  //T_XWP
      case 0b00010110:  //T_XWP
      case 0b00010111:  //T_XWP
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //T_XHC
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //T_XHCT
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //T_XHCG
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //T_XHCGT
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //T_XHPT
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //T_XHPG
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //T_XHPGT
        T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //T_A
      case 0b01000001:  //T_A
      case 0b01000010:  //T_A
      case 0b01000011:  //T_A
      case 0b01000100:  //T_A
      case 0b01000101:  //T_A
      case 0b01000110:  //T_A
      case 0b01000111:  //T_A
      case 0b01001000:  //T_A
      case 0b01001001:  //T_A
      case 0b01001010:  //T_A
      case 0b01001011:  //T_A
      case 0b01001100:  //T_A
      case 0b01001101:  //T_A
      case 0b01001110:  //T_A
      case 0b01001111:  //T_A
      case 0b01010000:  //T_A
      case 0b01010001:  //T_A
      case 0b01010010:  //T_A
      case 0b01010011:  //T_A
      case 0b01010100:  //T_A
      case 0b01010101:  //T_A
      case 0b01010110:  //T_A
      case 0b01010111:  //T_A
      case 0b01011000:  //T_A
      case 0b01011001:  //T_A
      case 0b01011010:  //T_A
      case 0b01011011:  //T_A
      case 0b01011100:  //T_A
      case 0b01011101:  //T_A
      case 0b01011110:  //T_A
      case 0b01011111:  //T_A
        N.drawRaster (src, dst, rh);
        break;
      default:
        T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XT);
      }  //switch
    }  //drawRaster
  },  //XT

  //================================================================================
  //ST ($0000,$06xx,$0060)
  //  概要
  //    ST  スプライト＞テキスト
  //    拡張なし
  //  手順
  //    スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //      スプライトカラー(0は黒)
  //    さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //      テキストカラー(0は黒)
  //  中間コード1
  //    (ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))
  //  中間コード2
  //    ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||(v2=txp())==0?spc(v1):tpc(v2)
  //  中間コード4
  //    ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    ((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    ((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  ST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //ST

  //================================================================================
  //XST
  //  概要
  //    ST  スプライト＞テキスト
  //    拡張あり
  XST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //ST_XWC
      case 0b00010001:  //ST_XWC
      case 0b00010010:  //ST_XWC
      case 0b00010011:  //ST_XWC
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //ST_XWP
      case 0b00010101:  //ST_XWP
      case 0b00010110:  //ST_XWP
      case 0b00010111:  //ST_XWP
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //ST_XHC
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //ST_XHCT
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //ST_XHCG
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //ST_XHCGT
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //ST_XHPT
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //ST_XHPG
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //ST_XHPGT
        ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //ST_A
      case 0b01000001:  //ST_A
      case 0b01000010:  //ST_A
      case 0b01000011:  //ST_A
      case 0b01000100:  //ST_A
      case 0b01000101:  //ST_A
      case 0b01000110:  //ST_A
      case 0b01000111:  //ST_A
      case 0b01001000:  //ST_A
      case 0b01001001:  //ST_A
      case 0b01001010:  //ST_A
      case 0b01001011:  //ST_A
      case 0b01001100:  //ST_A
      case 0b01001101:  //ST_A
      case 0b01001110:  //ST_A
      case 0b01001111:  //ST_A
      case 0b01010000:  //ST_A
      case 0b01010001:  //ST_A
      case 0b01010010:  //ST_A
      case 0b01010011:  //ST_A
      case 0b01010100:  //ST_A
      case 0b01010101:  //ST_A
      case 0b01010110:  //ST_A
      case 0b01010111:  //ST_A
      case 0b01011000:  //ST_A
      case 0b01011001:  //ST_A
      case 0b01011010:  //ST_A
      case 0b01011011:  //ST_A
      case 0b01011100:  //ST_A
      case 0b01011101:  //ST_A
      case 0b01011110:  //ST_A
      case 0b01011111:  //ST_A
        N.drawRaster (src, dst, rh);
        break;
      default:
        ST.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XST);
      }  //switch
    }  //drawRaster
  },  //XST

  //================================================================================
  //TS ($0000,$12xx,$0060)
  //  概要
  //    TS  テキスト＞スプライト
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?tpc(txp()):spc(spp()))
  //  中間コード2
  //    txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=txp())!=0?tpc(v0):spc(spp())
  //  中間コード4
  //    (p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=txp())!=0?tpo(p):spo(spp())
  TS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TS

  //================================================================================
  //XTS
  //  概要
  //    TS  テキスト＞スプライト
  //    拡張あり
  XTS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TS_XWC
      case 0b00010001:  //TS_XWC
      case 0b00010010:  //TS_XWC
      case 0b00010011:  //TS_XWC
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TS_XWP
      case 0b00010101:  //TS_XWP
      case 0b00010110:  //TS_XWP
      case 0b00010111:  //TS_XWP
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TS_XHC
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TS_XHCT
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TS_XHCG
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TS_XHCGT
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TS_XHPT
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TS_XHPG
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TS_XHPGT
        TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TS_A
      case 0b01000001:  //TS_A
      case 0b01000010:  //TS_A
      case 0b01000011:  //TS_A
      case 0b01000100:  //TS_A
      case 0b01000101:  //TS_A
      case 0b01000110:  //TS_A
      case 0b01000111:  //TS_A
      case 0b01001000:  //TS_A
      case 0b01001001:  //TS_A
      case 0b01001010:  //TS_A
      case 0b01001011:  //TS_A
      case 0b01001100:  //TS_A
      case 0b01001101:  //TS_A
      case 0b01001110:  //TS_A
      case 0b01001111:  //TS_A
      case 0b01010000:  //TS_A
      case 0b01010001:  //TS_A
      case 0b01010010:  //TS_A
      case 0b01010011:  //TS_A
      case 0b01010100:  //TS_A
      case 0b01010101:  //TS_A
      case 0b01010110:  //TS_A
      case 0b01010111:  //TS_A
      case 0b01011000:  //TS_A
      case 0b01011001:  //TS_A
      case 0b01011010:  //TS_A
      case 0b01011011:  //TS_A
      case 0b01011100:  //TS_A
      case 0b01011101:  //TS_A
      case 0b01011110:  //TS_A
      case 0b01011111:  //TS_A
        N.drawRaster (src, dst, rh);
        break;
      default:
        TS.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTS);
      }  //switch
    }  //drawRaster
  },  //XTS

  //================================================================================
  //E1 ($0000,$06xx,$0001)
  //  概要
  //    E1  512ドット16色1プレーン
  //    拡張なし
  //  手順
  //    1番目のカラー(0は黒)
  //  中間コード1
  //    epc(e1p())
  //  中間コード2
  //    epc(e1p())
  //  中間コード3
  //    epc(e1p())
  //  中間コード4
  //    epc(e1p())
  //  中間コード5
  //    epc(e1p())
  //  中間コード6
  //    epo(e1p())
  E1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        da += half;
      }
      while (da < db) {
        XEiJ.pnlBM[da] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]);
        gx1st += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1

  //================================================================================
  //XE1
  //  概要
  //    E1  512ドット16色1プレーン
  //    拡張あり
  XE1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E1_XWC
      case 0b00010001:  //E1_XWC
      case 0b00010010:  //E1_XWC
      case 0b00010011:  //E1_XWC
        E1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E1_XWP
      case 0b00010101:  //E1_XWP
      case 0b00010110:  //E1_XWP
      case 0b00010111:  //E1_XWP
        E1_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E1_XHC
        E1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E1_XHCT
        E1_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E1_XHCG
        E1_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E1_XHCGT
        E1_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E1_XHPT
        E1_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E1_XHPG
        E1_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E1_XHPGT
        E1_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E1_A
      case 0b01000001:  //E1_A
      case 0b01000010:  //E1_A
      case 0b01000011:  //E1_A
      case 0b01000100:  //E1_A
      case 0b01000101:  //E1_A
      case 0b01000110:  //E1_A
      case 0b01000111:  //E1_A
      case 0b01001000:  //E1_A
      case 0b01001001:  //E1_A
      case 0b01001010:  //E1_A
      case 0b01001011:  //E1_A
      case 0b01001100:  //E1_A
      case 0b01001101:  //E1_A
      case 0b01001110:  //E1_A
      case 0b01001111:  //E1_A
      case 0b01010000:  //E1_A
      case 0b01010001:  //E1_A
      case 0b01010010:  //E1_A
      case 0b01010011:  //E1_A
      case 0b01010100:  //E1_A
      case 0b01010101:  //E1_A
      case 0b01010110:  //E1_A
      case 0b01010111:  //E1_A
      case 0b01011000:  //E1_A
      case 0b01011001:  //E1_A
      case 0b01011010:  //E1_A
      case 0b01011011:  //E1_A
      case 0b01011100:  //E1_A
      case 0b01011101:  //E1_A
      case 0b01011110:  //E1_A
      case 0b01011111:  //E1_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        E1.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE1);
      }  //switch
    }  //drawRaster
  },  //XE1

  //================================================================================
  //E1_XWP ($0000,$06xx,$1401)
  //  概要
  //    E1  512ドット16色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):epc(tev(e1p())))
  //  中間コード2
  //    e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())<=1?epc(0):ls1(v0)==0?epc(v0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())<=1?epc(0):ls1(p)==0?epc(p):epc(tev(p))
  //  中間コード5
  //    (p=e1p())<=1?epc(0):(p&1)==0?epc(p):epc(p&-2)
  //  中間コード6
  //    (p=e1p())<=1?epo(0):(p&1)==0?epo(p):epo(p&-2)
  E1_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        gx1st += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1_XWP

  //================================================================================
  //E1_XHCT ($0000,$06xx,$1901)
  //  概要
  //    E1  512ドット16色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())
  //  中間コード3
  //    ls1(epc(tev(v3=e1p())))!=0?mix(epc(v3),0):epc(v3)
  //  中間コード4
  //    ls1(epc(tev(p=e1p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (epc((p=e1p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  E1_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              0)] :
                          VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        gx1st += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1_XHCT

  //================================================================================
  //E1_XHCG ($0000,$06xx,$1A01)
  //  概要
  //    E1  512ドット16色1プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(v1,epc(tod(e2q()))):ls1(v3)!=0?epc(tod(e2q())):epc(v3)
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?epc(tod(e2q())):epc(q)
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?epc(e2q()|1):epc(q)
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?epo(e2q()|1):epo(q)
  E1_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              p,
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                          (q & 1) != 0 ?
                          VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                          VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                              VideoController.vcnPal32G8[q]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1_XHCG

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

  //================================================================================
  //E1_XHPT ($0000,$06xx,$1D01)
  //  概要
  //    E1  512ドット16色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))
  //  中間コード2
  //    e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)
  //  中間コード3
  //    (v0=e1p())<=1?epc(0):ls1(v0)==0?epc(v0):mix(epc(tev(v0)),0)
  //  中間コード4
  //    (p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0)
  //  中間コード5
  //    (p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0)
  //  中間コード6
  //    (p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0))
  E1_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p & -2],
                              0)]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        gx1st += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1_XHPT

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

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

  //================================================================================
  //E1_A ($0000,$06xx,$4001)
  //  概要
  //    E1  512ドット16色1プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(epc(e1p()),tpc(0))
  //  中間コード2
  //    mix(epc(e1p()),tpc(0))
  //  中間コード3
  //    mix(epc(e1p()),tpc(0))
  //  中間コード4
  //    mix(epc(e1p()),tpc(0))
  //  中間コード5
  //    mix(epc(e1p()),tpc(0))
  //  中間コード6
  //    cto(mix(epc(e1p()),tpc(0)))
  E1_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        da += half;
      }
      while (da < db) {
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]],
                              VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        gx1st += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1_A

  //================================================================================
  //E2 ($0000,$06xx,$0003)
  //  概要
  //    E2  512ドット16色2プレーン
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?epc(e1p()):epc(e2p()))
  //  中間コード2
  //    e1p()!=0?epc(e1p()):epc(e2p())
  //  中間コード3
  //    (v0=e1p())!=0?epc(v0):epc(e2p())
  //  中間コード4
  //    (p=e1p())!=0?epc(p):epc(e2p())
  //  中間コード5
  //    (p=e1p())!=0?epc(p):epc(e2p())
  //  中間コード6
  //    (p=e1p())!=0?epo(p):epo(e2p())
  E2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2

  //================================================================================
  //XE2
  //  概要
  //    E2  512ドット16色2プレーン
  //    拡張あり
  XE2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E2_XWC
      case 0b00010001:  //E2_XWC
      case 0b00010010:  //E2_XWC
      case 0b00010011:  //E2_XWC
        E2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E2_XWP
      case 0b00010101:  //E2_XWP
      case 0b00010110:  //E2_XWP
      case 0b00010111:  //E2_XWP
        E2_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E2_XHC
        E2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E2_XHCT
        E2_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E2_XHCG
        E2_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E2_XHCGT
        E2_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E2_XHPT
        E2_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E2_XHPG
        E2_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E2_XHPGT
        E2_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E2_A
      case 0b01000001:  //E2_A
      case 0b01000010:  //E2_A
      case 0b01000011:  //E2_A
      case 0b01000100:  //E2_A
      case 0b01000101:  //E2_A
      case 0b01000110:  //E2_A
      case 0b01000111:  //E2_A
      case 0b01001000:  //E2_A
      case 0b01001001:  //E2_A
      case 0b01001010:  //E2_A
      case 0b01001011:  //E2_A
      case 0b01001100:  //E2_A
      case 0b01001101:  //E2_A
      case 0b01001110:  //E2_A
      case 0b01001111:  //E2_A
      case 0b01010000:  //E2_A
      case 0b01010001:  //E2_A
      case 0b01010010:  //E2_A
      case 0b01010011:  //E2_A
      case 0b01010100:  //E2_A
      case 0b01010101:  //E2_A
      case 0b01010110:  //E2_A
      case 0b01010111:  //E2_A
      case 0b01011000:  //E2_A
      case 0b01011001:  //E2_A
      case 0b01011010:  //E2_A
      case 0b01011011:  //E2_A
      case 0b01011100:  //E2_A
      case 0b01011101:  //E2_A
      case 0b01011110:  //E2_A
      case 0b01011111:  //E2_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        E2.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE2);
      }  //switch
    }  //drawRaster
  },  //XE2

  //================================================================================
  //E2_XWP ($0000,$06xx,$1403)
  //  概要
  //    E2  512ドット16色2プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?epc(tev(e2p())):v0==1?epc(0):ls1(v0)==0?epc(v0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):epo(p&-2)
  E2_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                          VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                          p == 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2_XWP

  //================================================================================
  //E2_XHCT ($0000,$06xx,$1903)
  //  概要
  //    E2  512ドット16色2プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),0):epc(v0):ls1(epc(tev(v10=e2p())))!=0?mix(epc(v10),0):epc(v10)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  E2_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                          (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              0)] :
                          VideoController.vcnPal32G8[p] :
                          (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              0)] :
                          VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2_XHCT

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

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

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

  //================================================================================
  //E2_XHPG ($0000,$06xx,$1E03)
  //  概要
  //    E2  512ドット16色2プレーン
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p())))
  //  中間コード3
  //    (v0=e1p())==0?epc(tev(e2p())):v0==1?epc(0):ls1(v0)==0?epc(v0):mix(epc(tev(v0)),epc(tod(e2p())))
  //  中間コード4
  //    (p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p())))
  //  中間コード5
  //    (p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1))
  //  中間コード6
  //    (p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1)))
  E2_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                          VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                          p == 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p & -2],
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2_XHPG

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

  //================================================================================
  //E2_A ($0000,$06xx,$4003)
  //  概要
  //    E2  512ドット16色2プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?mix(epc(e1p()),tpc(0)):mix(epc(e2p()),tpc(0)))
  //  中間コード2
  //    e1p()!=0?mix(epc(e1p()),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード3
  //    (v0=e1p())!=0?mix(epc(v0),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード4
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード5
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード6
  //    cto((p=e1p())!=0?mix(epc(p),tpc(0)):mix(epc(e2p()),tpc(0)))
  E2_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              VideoController.vcnPal16TS[0]) :
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]],
                              VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2_A

  //================================================================================
  //E3 ($0000,$06xx,$0007)
  //  概要
  //    E3  512ドット16色3プレーン
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):epc(e3p())))
  //  中間コード2
  //    e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):epc(e3p())
  //  中間コード3
  //    (v0=e1p())!=0?epc(v0):(v2=e2p())!=0?epc(v2):epc(e3p())
  //  中間コード4
  //    (p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p())
  //  中間コード5
  //    (p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p())
  //  中間コード6
  //    (p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):epo(e3p())
  E3 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                          VideoController.vcnPal32G8[p] :
                          (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3

  //================================================================================
  //XE3
  //  概要
  //    E3  512ドット16色3プレーン
  //    拡張あり
  XE3 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E3_XWC
      case 0b00010001:  //E3_XWC
      case 0b00010010:  //E3_XWC
      case 0b00010011:  //E3_XWC
        E3.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E3_XWP
      case 0b00010101:  //E3_XWP
      case 0b00010110:  //E3_XWP
      case 0b00010111:  //E3_XWP
        E3_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E3_XHC
        E3.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E3_XHCT
        E3_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E3_XHCG
        E3_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E3_XHCGT
        E3_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E3_XHPT
        E3_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E3_XHPG
        E3_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E3_XHPGT
        E3_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E3_A
      case 0b01000001:  //E3_A
      case 0b01000010:  //E3_A
      case 0b01000011:  //E3_A
      case 0b01000100:  //E3_A
      case 0b01000101:  //E3_A
      case 0b01000110:  //E3_A
      case 0b01000111:  //E3_A
      case 0b01001000:  //E3_A
      case 0b01001001:  //E3_A
      case 0b01001010:  //E3_A
      case 0b01001011:  //E3_A
      case 0b01001100:  //E3_A
      case 0b01001101:  //E3_A
      case 0b01001110:  //E3_A
      case 0b01001111:  //E3_A
      case 0b01010000:  //E3_A
      case 0b01010001:  //E3_A
      case 0b01010010:  //E3_A
      case 0b01010011:  //E3_A
      case 0b01010100:  //E3_A
      case 0b01010101:  //E3_A
      case 0b01010110:  //E3_A
      case 0b01010111:  //E3_A
      case 0b01011000:  //E3_A
      case 0b01011001:  //E3_A
      case 0b01011010:  //E3_A
      case 0b01011011:  //E3_A
      case 0b01011100:  //E3_A
      case 0b01011101:  //E3_A
      case 0b01011110:  //E3_A
      case 0b01011111:  //E3_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        E3.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE3);
      }  //switch
    }  //drawRaster
  },  //XE3

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

  //================================================================================
  //E3_XHCT ($0000,$06xx,$1907)
  //  概要
  //    E3  512ドット16色3プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),0):epc(v0):(v7=e2p())!=0?ls1(epc(tev(v7)))!=0?mix(epc(v7),0):epc(v7):ls1(epc(tev(v17=e3p())))!=0?mix(epc(v17),0):epc(v17)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  E3_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                          (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              0)] :
                          VideoController.vcnPal32G8[p] :
                          (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                          (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              0)] :
                          VideoController.vcnPal32G8[p] :
                          (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              0)] :
                          VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3_XHCT

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

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

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

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

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

  //================================================================================
  //E3_A ($0000,$06xx,$4007)
  //  概要
  //    E3  512ドット16色3プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?mix(epc(e1p()),tpc(0)):(e2p()!=0?mix(epc(e2p()),tpc(0)):mix(epc(e3p()),tpc(0))))
  //  中間コード2
  //    e1p()!=0?mix(epc(e1p()),tpc(0)):e2p()!=0?mix(epc(e2p()),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード3
  //    (v0=e1p())!=0?mix(epc(v0),tpc(0)):(v4=e2p())!=0?mix(epc(v4),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード4
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード5
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード6
  //    cto((p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):mix(epc(e3p()),tpc(0)))
  E3_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              VideoController.vcnPal16TS[0]) :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              VideoController.vcnPal16TS[0]) :
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]],
                              VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3_A

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

  //================================================================================
  //XE4
  //  概要
  //    E4  512ドット16色4プレーン
  //    拡張あり
  XE4 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E4_XWC
      case 0b00010001:  //E4_XWC
      case 0b00010010:  //E4_XWC
      case 0b00010011:  //E4_XWC
        E4.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E4_XWP
      case 0b00010101:  //E4_XWP
      case 0b00010110:  //E4_XWP
      case 0b00010111:  //E4_XWP
        E4_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E4_XHC
        E4.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E4_XHCT
        E4_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E4_XHCG
        E4_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E4_XHCGT
        E4_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E4_XHPT
        E4_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E4_XHPG
        E4_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E4_XHPGT
        E4_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E4_A
      case 0b01000001:  //E4_A
      case 0b01000010:  //E4_A
      case 0b01000011:  //E4_A
      case 0b01000100:  //E4_A
      case 0b01000101:  //E4_A
      case 0b01000110:  //E4_A
      case 0b01000111:  //E4_A
      case 0b01001000:  //E4_A
      case 0b01001001:  //E4_A
      case 0b01001010:  //E4_A
      case 0b01001011:  //E4_A
      case 0b01001100:  //E4_A
      case 0b01001101:  //E4_A
      case 0b01001110:  //E4_A
      case 0b01001111:  //E4_A
      case 0b01010000:  //E4_A
      case 0b01010001:  //E4_A
      case 0b01010010:  //E4_A
      case 0b01010011:  //E4_A
      case 0b01010100:  //E4_A
      case 0b01010101:  //E4_A
      case 0b01010110:  //E4_A
      case 0b01010111:  //E4_A
      case 0b01011000:  //E4_A
      case 0b01011001:  //E4_A
      case 0b01011010:  //E4_A
      case 0b01011011:  //E4_A
      case 0b01011100:  //E4_A
      case 0b01011101:  //E4_A
      case 0b01011110:  //E4_A
      case 0b01011111:  //E4_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        E4.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE4);
      }  //switch
    }  //drawRaster
  },  //XE4

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

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

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

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

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

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

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

  //================================================================================
  //E4_A ($0000,$06xx,$400F)
  //  概要
  //    E4  512ドット16色4プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?mix(epc(e1p()),tpc(0)):(e2p()!=0?mix(epc(e2p()),tpc(0)):(e3p()!=0?mix(epc(e3p()),tpc(0)):mix(epc(e4p()),tpc(0)))))
  //  中間コード2
  //    e1p()!=0?mix(epc(e1p()),tpc(0)):e2p()!=0?mix(epc(e2p()),tpc(0)):e3p()!=0?mix(epc(e3p()),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード3
  //    (v0=e1p())!=0?mix(epc(v0),tpc(0)):(v4=e2p())!=0?mix(epc(v4),tpc(0)):(v8=e3p())!=0?mix(epc(v8),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード4
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):(p=e3p())!=0?mix(epc(p),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード5
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):(p=e3p())!=0?mix(epc(p),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード6
  //    cto((p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):(p=e3p())!=0?mix(epc(p),tpc(0)):mix(epc(e4p()),tpc(0)))
  E4_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              VideoController.vcnPal16TS[0]) :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              VideoController.vcnPal16TS[0]) :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              VideoController.vcnPal16TS[0]) :
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]],
                              VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]],
                                  VideoController.vcnPal16TS[0])]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E4_A

  //================================================================================
  //F1 ($0001,$06xx,$0003)
  //  概要
  //    F1  512ドット256色1プレーン
  //    拡張なし
  //  手順
  //    1番目のカラー(0は黒)
  //  中間コード1
  //    fpc(f1p())
  //  中間コード2
  //    fpc(f1p())
  //  中間コード3
  //    fpc(f1p())
  //  中間コード4
  //    fpc(f1p())
  //  中間コード5
  //    fpc(f1p())
  //  中間コード6
  //    fpo(f1p())
  F1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        XEiJ.pnlBM[da] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                      GraphicScreen.graM4[gy1st | gx1st & 511])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1

  //================================================================================
  //XF1
  //  概要
  //    F1  512ドット256色1プレーン
  //    拡張あり
  XF1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F1_XWC
      case 0b00010001:  //F1_XWC
      case 0b00010010:  //F1_XWC
      case 0b00010011:  //F1_XWC
        F1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F1_XWP
      case 0b00010101:  //F1_XWP
      case 0b00010110:  //F1_XWP
      case 0b00010111:  //F1_XWP
        F1_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F1_XHC
        F1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F1_XHCT
        F1_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F1_XHCG
        F1_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F1_XHCGT
        F1_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F1_XHPT
        F1_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F1_XHPG
        F1_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F1_XHPGT
        F1_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F1_A
      case 0b01000001:  //F1_A
      case 0b01000010:  //F1_A
      case 0b01000011:  //F1_A
      case 0b01000100:  //F1_A
      case 0b01000101:  //F1_A
      case 0b01000110:  //F1_A
      case 0b01000111:  //F1_A
      case 0b01001000:  //F1_A
      case 0b01001001:  //F1_A
      case 0b01001010:  //F1_A
      case 0b01001011:  //F1_A
      case 0b01001100:  //F1_A
      case 0b01001101:  //F1_A
      case 0b01001110:  //F1_A
      case 0b01001111:  //F1_A
      case 0b01010000:  //F1_A
      case 0b01010001:  //F1_A
      case 0b01010010:  //F1_A
      case 0b01010011:  //F1_A
      case 0b01010100:  //F1_A
      case 0b01010101:  //F1_A
      case 0b01010110:  //F1_A
      case 0b01010111:  //F1_A
      case 0b01011000:  //F1_A
      case 0b01011001:  //F1_A
      case 0b01011010:  //F1_A
      case 0b01011011:  //F1_A
      case 0b01011100:  //F1_A
      case 0b01011101:  //F1_A
      case 0b01011110:  //F1_A
      case 0b01011111:  //F1_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        F1.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF1);
      }  //switch
    }  //drawRaster
  },  //XF1

  //================================================================================
  //F1_XWP ($0001,$06xx,$1403)
  //  概要
  //    F1  512ドット256色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?fpc(0):ls1(v0)==0?fpc(v0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):fpo(p&-2)
  F1_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_XWP

  //================================================================================
  //F1_XHCT ($0001,$06xx,$1903)
  //  概要
  //    F1  512ドット256色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?mix(fpc(v3),0):fpc(v3)
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),0):fpc(p)
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),0):fpc(p)
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p)
  F1_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        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],
                              0)] :
                          VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_XHCT

  //================================================================================
  //F1_XHCG ($0001,$06xx,$1A03)
  //  概要
  //    F1  512ドット256色1プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(v1,fpc(tod(f2q()))):ls1(v3)!=0?fpc(tod(f2q())):fpc(v3)
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?fpc(tod(f2q())):fpc(q)
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?fpc(f2q()|1):fpc(q)
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?fpo(f2q()|1):fpo(q)
  F1_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                          VideoController.vcnPal32G8[q]);
        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 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_XHCG

  //================================================================================
  //F1_XHCGT ($0001,$06xx,$1B03)
  //  概要
  //    F1  512ドット256色1プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(mix(v1,fpc(tod(f2q()))),0):ls1(v3)!=0?fpc(tod(f2q())):fpc(v3)
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),0):ls1(q)!=0?fpc(tod(f2q())):fpc(q)
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),0):(q&1)!=0?fpc(f2q()|1):fpc(q)
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),0)):(q&1)!=0?fpo(f2q()|1):fpo(q)
  F1_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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]),
                              0)] :
                          (q & 1) != 0 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                          VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                  0)] :
                              (q & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                              VideoController.vcnPal32G8[q]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_XHCGT

  //================================================================================
  //F1_XHPT ($0001,$06xx,$1D03)
  //  概要
  //    F1  512ドット256色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0))
  //  中間コード2
  //    f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0)
  //  中間コード3
  //    (v0=f1p())<=1?fpc(0):ls1(v0)==0?fpc(v0):mix(fpc(tev(v0)),0)
  //  中間コード4
  //    (p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),0)
  //  中間コード5
  //    (p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),0)
  //  中間コード6
  //    (p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),0))
  F1_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p & -2],
                              0)]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_XHPT

  //================================================================================
  //F1_XHPG ($0001,$06xx,$1E03)
  //  概要
  //    F1  512ドット256色1プレーン
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2q()))))
  //  中間コード2
  //    f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2q())))
  //  中間コード3
  //    (v0=f1p())<=1?fpc(0):ls1(v0)==0?fpc(v0):mix(fpc(tev(v0)),fpc(tod(f2q())))
  //  中間コード4
  //    (p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),fpc(tod(f2q())))
  //  中間コード5
  //    (p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),fpc(f2q()|1))
  //  中間コード6
  //    (p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),fpc(f2q()|1)))
  F1_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p & -2],
                              VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_XHPG

  //================================================================================
  //F1_XHPGT ($0001,$06xx,$1F03)
  //  概要
  //    F1  512ドット256色1プレーン
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0))
  //  中間コード2
  //    f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0)
  //  中間コード3
  //    (v0=f1p())<=1?fpc(0):ls1(v0)==0?fpc(v0):mix(mix(fpc(tev(v0)),fpc(tod(f2q()))),0)
  //  中間コード4
  //    (p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(mix(fpc(tev(p)),fpc(tod(f2q()))),0)
  //  中間コード5
  //    (p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(mix(fpc(p&-2),fpc(f2q()|1)),0)
  //  中間コード6
  //    (p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(mix(fpc(p&-2),fpc(f2q()|1)),0))
  F1_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                              0)]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                  0)]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_XHPGT

  //================================================================================
  //F1_A ($0001,$06xx,$4003)
  //  概要
  //    F1  512ドット256色1プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード2
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード3
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード4
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード5
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード6
  //    cto(mix(fpc(f1p()),tpc(0)))
  F1_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                          GraphicScreen.graM4[gy1st | gx1st & 511])],
                              VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 1 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 2 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 3 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 4 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 5 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 6 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st + 7 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F1_A

  //================================================================================
  //F2 ($0001,$06xx,$000F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?fpc(f1p()):fpc(f2p()))
  //  中間コード2
  //    f1p()!=0?fpc(f1p()):fpc(f2p())
  //  中間コード3
  //    (v0=f1p())!=0?fpc(v0):fpc(f2p())
  //  中間コード4
  //    (p=f1p())!=0?fpc(p):fpc(f2p())
  //  中間コード5
  //    (p=f1p())!=0?fpc(p):fpc(f2p())
  //  中間コード6
  //    (p=f1p())!=0?fpo(p):fpo(f2p())
  F2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gy3rd | gx3rd & 511])]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2

  //================================================================================
  //XF2
  //  概要
  //    F2  512ドット256色2プレーン
  //    拡張あり
  XF2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F2_XWC
      case 0b00010001:  //F2_XWC
      case 0b00010010:  //F2_XWC
      case 0b00010011:  //F2_XWC
        F2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F2_XWP
      case 0b00010101:  //F2_XWP
      case 0b00010110:  //F2_XWP
      case 0b00010111:  //F2_XWP
        F2_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F2_XHC
        F2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F2_XHCT
        F2_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F2_XHCG
        F2_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F2_XHCGT
        F2_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F2_XHPT
        F2_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F2_XHPG
        F2_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F2_XHPGT
        F2_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F2_A
      case 0b01000001:  //F2_A
      case 0b01000010:  //F2_A
      case 0b01000011:  //F2_A
      case 0b01000100:  //F2_A
      case 0b01000101:  //F2_A
      case 0b01000110:  //F2_A
      case 0b01000111:  //F2_A
      case 0b01001000:  //F2_A
      case 0b01001001:  //F2_A
      case 0b01001010:  //F2_A
      case 0b01001011:  //F2_A
      case 0b01001100:  //F2_A
      case 0b01001101:  //F2_A
      case 0b01001110:  //F2_A
      case 0b01001111:  //F2_A
      case 0b01010000:  //F2_A
      case 0b01010001:  //F2_A
      case 0b01010010:  //F2_A
      case 0b01010011:  //F2_A
      case 0b01010100:  //F2_A
      case 0b01010101:  //F2_A
      case 0b01010110:  //F2_A
      case 0b01010111:  //F2_A
      case 0b01011000:  //F2_A
      case 0b01011001:  //F2_A
      case 0b01011010:  //F2_A
      case 0b01011011:  //F2_A
      case 0b01011100:  //F2_A
      case 0b01011101:  //F2_A
      case 0b01011110:  //F2_A
      case 0b01011111:  //F2_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        F2.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF2);
      }  //switch
    }  //drawRaster
  },  //XF2

  //================================================================================
  //F2_XWP ($0001,$06xx,$140F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?fpc(tev(f2p())):v0==1?fpc(0):ls1(v0)==0?fpc(v0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?fpc(tev(f2p())):p==1?fpc(0):ls1(p)==0?fpc(p):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?fpc(f2p()&-2):p==1?fpc(0):(p&1)==0?fpc(p):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?fpo(f2p()&-2):p==1?fpo(0):(p&1)==0?fpo(p):fpo(p&-2)
  F2_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                          p == 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_XWP

  //================================================================================
  //F2_XHCT ($0001,$06xx,$190F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p())))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?mix(fpc(v0),0):fpc(v0):ls1(fpc(tev(v10=f2p())))!=0?mix(fpc(v10),0):fpc(v10)
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),0):fpc(p):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),0):fpc(p)
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),0):fpc(p):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),0):fpc(p)
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p)
  F2_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        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],
                              0)] :
                          VideoController.vcnPal32G8[p] :
                          (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              0)] :
                          VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                              (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_XHCT

  //================================================================================
  //F2_XHCG ($0001,$06xx,$1A0F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(v2,fpc(tod(f2q()))):ls1(v0)!=0?fpc(tod(f2q())):fpc(v0):ls1(v14=fpc(tev(v16=f2p())))!=0?mix(v14,fpc(tod(f2q()))):fpc(v16)
  //  中間コード4
  //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?fpc(tod(f2q())):fpc(p):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):fpc(q)
  //  中間コード5
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?fpc(f2q()|1):fpc(p):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):fpc(q)
  //  中間コード6
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(q,fpc(f2q()|1))):(p&1)!=0?fpo(f2q()|1):fpo(p):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):fpo(q)
  F2_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                          VideoController.vcnPal32G8[p] :
                          ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              p,
                              VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                          VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                              VideoController.vcnPal32G8[q]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_XHCG

  //================================================================================
  //F2_XHCGT ($0001,$06xx,$1B0F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))):(ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),0):fpc(f2p())))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),0):fpc(f2p())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(mix(v2,fpc(tod(f2q()))),0):ls1(v0)!=0?fpc(tod(f2q())):fpc(v0):ls1(v15=fpc(tev(v17=f2p())))!=0?mix(mix(v15,fpc(tod(f2q()))),0):fpc(v17)
  //  中間コード4
  //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(mix(q,fpc(tod(f2q()))),0):ls1(p)!=0?fpc(tod(f2q())):fpc(p):ls1(p=fpc(tev(q=f2p())))!=0?mix(mix(p,fpc(tod(f2q()))),0):fpc(q)
  //  中間コード5
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(mix(q,fpc(f2q()|1)),0):(p&1)!=0?fpc(f2q()|1):fpc(p):((p=fpc((q=f2p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),0):fpc(q)
  //  中間コード6
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(mix(q,fpc(f2q()|1)),0)):(p&1)!=0?fpo(f2q()|1):fpo(p):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),0)):fpo(q)
  F2_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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]),
                              0)] :
                          (p & 1) != 0 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                          VideoController.vcnPal32G8[p] :
                          ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                              0)] :
                          VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                              ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                  0)] :
                              (p & 1) != 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                              VideoController.vcnPal32G8[p] :
                              ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                  0)] :
                              VideoController.vcnPal32G8[q]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_XHCGT

  //================================================================================
  //F2_XHPT ($0001,$06xx,$1D0F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0)
  //  中間コード3
  //    (v0=f1p())==0?fpc(tev(f2p())):v0==1?fpc(0):ls1(v0)==0?fpc(v0):mix(fpc(tev(v0)),0)
  //  中間コード4
  //    (p=f1p())==0?fpc(tev(f2p())):p==1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),0)
  //  中間コード5
  //    (p=f1p())==0?fpc(f2p()&-2):p==1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),0)
  //  中間コード6
  //    (p=f1p())==0?fpo(f2p()&-2):p==1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),0))
  F2_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                          p == 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p & -2],
                              0)]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_XHPT

  //================================================================================
  //F2_XHPG ($0001,$06xx,$1E0F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2p()))))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2p())))
  //  中間コード3
  //    (v0=f1p())==0?fpc(tev(f2p())):v0==1?fpc(0):ls1(v0)==0?fpc(v0):mix(fpc(tev(v0)),fpc(tod(f2p())))
  //  中間コード4
  //    (p=f1p())==0?fpc(tev(f2p())):p==1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),fpc(tod(f2p())))
  //  中間コード5
  //    (p=f1p())==0?fpc(f2p()&-2):p==1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),fpc(f2p()|1))
  //  中間コード6
  //    (p=f1p())==0?fpo(f2p()&-2):p==1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),fpc(f2p()|1)))
  F2_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                          p == 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p & -2],
                              VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd & 511]) | 1])]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) | 1])]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) | 1])]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) | 1])]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) | 1])]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) | 1])]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) | 1])]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) | 1])]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_XHPG

  //================================================================================
  //F2_XHPGT ($0001,$06xx,$1F0F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2p()))),0))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p())):f1p()==1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2p()))),0)
  //  中間コード3
  //    (v0=f1p())==0?fpc(tev(f2p())):v0==1?fpc(0):ls1(v0)==0?fpc(v0):mix(mix(fpc(tev(v0)),fpc(tod(f2p()))),0)
  //  中間コード4
  //    (p=f1p())==0?fpc(tev(f2p())):p==1?fpc(0):ls1(p)==0?fpc(p):mix(mix(fpc(tev(p)),fpc(tod(f2p()))),0)
  //  中間コード5
  //    (p=f1p())==0?fpc(f2p()&-2):p==1?fpc(0):(p&1)==0?fpc(p):mix(mix(fpc(p&-2),fpc(f2p()|1)),0)
  //  中間コード6
  //    (p=f1p())==0?fpo(f2p()&-2):p==1?fpo(0):(p&1)==0?fpo(p):cto(mix(mix(fpc(p&-2),fpc(f2p()|1)),0))
  F2_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                          VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                      GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                          p == 1 ?
                          VideoController.vcnPal32G8[0] :
                          (p & 1) == 0 ?
                          VideoController.vcnPal32G8[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd & 511]) | 1]),
                              0)]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) | 1]),
                                  0)]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                              VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                              p == 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) | 1]),
                                  0)]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_XHPGT

  //================================================================================
  //F2_A ($0001,$06xx,$400F)
  //  概要
  //    F2  512ドット256色2プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?mix(fpc(f1p()),tpc(0)):mix(fpc(f2p()),tpc(0)))
  //  中間コード2
  //    f1p()!=0?mix(fpc(f1p()),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード3
  //    (v0=f1p())!=0?mix(fpc(v0),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード4
  //    (p=f1p())!=0?mix(fpc(p),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード5
  //    (p=f1p())!=0?mix(fpc(p),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード6
  //    cto((p=f1p())!=0?mix(fpc(p),tpc(0)):mix(fpc(f2p()),tpc(0)))
  F2_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[p],
                              VideoController.vcnPal16TS[0]) :
                            VideoController.vcnMix2 (
                              VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                          GraphicScreen.graM4[gy3rd | gx3rd & 511])],
                              VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[0]) :
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])],
                                  VideoController.vcnPal16TS[0])]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //F2_A

  //================================================================================
  //G ($0003,$06xx,$000F)
  //  概要
  //    G  512ドット65536色1プレーン
  //    拡張なし
  //  手順
  //    1番目のカラー(0は黒)
  //  中間コード1
  //    gpc(g1p(),g1p())
  //  中間コード2
  //    gpc(g1p(),g1p())
  //  中間コード3
  //    gpc(v1=g1p(),v1)
  //  中間コード4
  //    gpc(p=g1p(),p)
  //  中間コード5
  //    gpc(p=g1p(),p)
  //  中間コード6
  //    gpo(p=g1p(),p)
  G {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 12 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                                              GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) >> 8] |
                            VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //G

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

  //================================================================================
  //G_XWP ($0003,$06xx,$140F)
  //  概要
  //    G  512ドット65536色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):gpc(tev(g1p()),tev(g1p())))
  //  中間コード2
  //    g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):gpc(tev(g1p()),tev(g1p()))
  //  中間コード3
  //    (v0=g1p())<=1?gpc(0,0):ls1(v0)==0?gpc(v0,v0):gpc(v5=tev(v0),v5)
  //  中間コード4
  //    (p=g1p())<=1?gpc(0,0):ls1(p)==0?gpc(p,p):gpc(q=tev(p),q)
  //  中間コード5
  //    (p=g1p())<=1?gpc(0,0):(p&1)==0?gpc(p,p):gpc(q=p&-2,q)
  //  中間コード6
  //    (p=g1p())<=1?gpo(0,0):(p&1)==0?gpo(p,p):gpo(q=p&-2,q)
  G_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[0 >> 8] |
                            VideoController.vcnPal8G16L[0 & 255]] :
                          (p & 1) == 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[p >> 8] |
                            VideoController.vcnPal8G16L[p & 255]] :
                          VideoController.vcnPalTbl[
                            VideoController.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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //G_XWP

  //================================================================================
  //G_XHCT ($0003,$06xx,$190F)
  //  概要
  //    G  512ドット65536色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
  //      1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(gpc(tod(g1p()),tod(g1p())))!=0?mix(gpc(g1p(),g1p()),0):gpc(g1p(),g1p()))
  //  中間コード2
  //    ls1(gpc(tod(g1p()),tod(g1p())))!=0?mix(gpc(g1p(),g1p()),0):gpc(g1p(),g1p())
  //  中間コード3
  //    ls1(gpc(v2=tod(v3=g1p()),v2))!=0?mix(gpc(v3,v3),0):gpc(v3,v3)
  //  中間コード4
  //    ls1(gpc(p=tod(q=g1p()),p))!=0?mix(gpc(q,q),0):gpc(q,q)
  //  中間コード5
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?mix(gpc(q,q),0):gpc(q,q)
  //  中間コード6
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?cto(mix(gpc(q,q),0)):gpo(q,q)
  G_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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]),
                              0)] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[q >> 8] |
                            VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //G_XHCT

  //================================================================================
  //G_XHPT ($0003,$06xx,$1D0F)
  //  概要
  //    G  512ドット65536色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0))
  //  中間コード2
  //    g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0)
  //  中間コード3
  //    (v0=g1p())<=1?gpc(0,0):ls1(v0)==0?gpc(v0,v0):mix(gpc(v6=tev(v0),v6),0)
  //  中間コード4
  //    (p=g1p())<=1?gpc(0,0):ls1(p)==0?gpc(p,p):mix(gpc(q=tev(p),q),0)
  //  中間コード5
  //    (p=g1p())<=1?gpc(0,0):(p&1)==0?gpc(p,p):mix(gpc(q=p&-2,q),0)
  //  中間コード6
  //    (p=g1p())<=1?gpo(0,0):(p&1)==0?gpo(p,p):cto(mix(gpc(q=p&-2,q),0))
  G_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[0 >> 8] |
                            VideoController.vcnPal8G16L[0 & 255]] :
                          (p & 1) == 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[p >> 8] |
                            VideoController.vcnPal8G16L[p & 255]] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                               VideoController.vcnPal8G16L[q & 255]),
                              0)]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //G_XHPT

  //================================================================================
  //G_A ($0003,$06xx,$400F)
  //  概要
  //    G  512ドット65536色1プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(gpc(g1p(),g1p()),tpc(0))
  //  中間コード2
  //    mix(gpc(g1p(),g1p()),tpc(0))
  //  中間コード3
  //    mix(gpc(v2=g1p(),v2),tpc(0))
  //  中間コード4
  //    mix(gpc(p=g1p(),p),tpc(0))
  //  中間コード5
  //    mix(gpc(p=g1p(),p),tpc(0))
  //  中間コード6
  //    cto(mix(gpc(p=g1p(),p),tpc(0)))
  G_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        da += half;
      }
      while (da < db) {
        int p;
        XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 12 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                                                 GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st & 511])) >> 8] |
                               VideoController.vcnPal8G16L[p & 255]),
                              VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                                                     GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                                                     GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                                                     GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                                                     GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                                                     GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                                                     GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
        XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                                                     GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                                                     GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                     GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //G_A

  //================================================================================
  //H ($0004,$06xx,$0010)
  //  概要
  //    H  1024ドット16色1プレーン
  //    拡張なし
  //  手順
  //    1番目のカラー(0は黒)
  //  中間コード1
  //    hpc(h1p())
  //  中間コード2
  //    hpc(h1p())
  //  中間コード3
  //    hpc(h1p())
  //  中間コード4
  //    hpc(h1p())
  //  中間コード5
  //    hpc(h1p())
  //  中間コード6
  //    hpo(h1p())
  H {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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) {
          XEiJ.pnlBM[da] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga]]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 1]]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 2]]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 3]]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 4]]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 5]]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 6]]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 7]]);
          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++;
            XEiJ.pnlBM[da] = (VideoController.vcnPal32G8[GraphicScreen.graM4[ga]]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //H

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

  //================================================================================
  //H_XWP ($0004,$06xx,$1410)
  //  概要
  //    H  1024ドット16色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):hpc(tev(h1p())))
  //  中間コード2
  //    h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):hpc(tev(h1p()))
  //  中間コード3
  //    (v0=h1p())<=1?hpc(0):ls1(v0)==0?hpc(v0):hpc(tev(v0))
  //  中間コード4
  //    (p=h1p())<=1?hpc(0):ls1(p)==0?hpc(p):hpc(tev(p))
  //  中間コード5
  //    (p=h1p())<=1?hpc(0):(p&1)==0?hpc(p):hpc(p&-2)
  //  中間コード6
  //    (p=h1p())<=1?hpo(0):(p&1)==0?hpo(p):hpo(p&-2)
  H_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 = GraphicScreen.graM4[ga]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          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 = GraphicScreen.graM4[ga]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //H_XWP

  //================================================================================
  //H_XHCT ($0004,$06xx,$1910)
  //  概要
  //    H  1024ドット16色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p()))
  //  中間コード2
  //    ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p())
  //  中間コード3
  //    ls1(hpc(tev(v3=h1p())))!=0?mix(hpc(v3),0):hpc(v3)
  //  中間コード4
  //    ls1(hpc(tev(p=h1p())))!=0?mix(hpc(p),0):hpc(p)
  //  中間コード5
  //    (hpc((p=h1p())&-2)&1)!=0?mix(hpc(p),0):hpc(p)
  //  中間コード6
  //    (hpc((p=h1p())&-2)&1)!=0?cto(mix(hpc(p),0)):hpo(p)
  H_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 1]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 2]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 3]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          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] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //H_XHCT

  //================================================================================
  //H_XHPT ($0004,$06xx,$1D10)
  //  概要
  //    H  1024ドット16色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0))
  //  中間コード2
  //    h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0)
  //  中間コード3
  //    (v0=h1p())<=1?hpc(0):ls1(v0)==0?hpc(v0):mix(hpc(tev(v0)),0)
  //  中間コード4
  //    (p=h1p())<=1?hpc(0):ls1(p)==0?hpc(p):mix(hpc(tev(p)),0)
  //  中間コード5
  //    (p=h1p())<=1?hpc(0):(p&1)==0?hpc(p):mix(hpc(p&-2),0)
  //  中間コード6
  //    (p=h1p())<=1?hpo(0):(p&1)==0?hpo(p):cto(mix(hpc(p&-2),0))
  H_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 = GraphicScreen.graM4[ga]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          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 = GraphicScreen.graM4[ga]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //H_XHPT

  //================================================================================
  //H_A ($0004,$06xx,$4010)
  //  概要
  //    H  1024ドット16色1プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(hpc(h1p()),tpc(0))
  //  中間コード2
  //    mix(hpc(h1p()),tpc(0))
  //  中間コード3
  //    mix(hpc(h1p()),tpc(0))
  //  中間コード4
  //    mix(hpc(h1p()),tpc(0))
  //  中間コード5
  //    mix(hpc(h1p()),tpc(0))
  //  中間コード6
  //    cto(mix(hpc(h1p()),tpc(0)))
  H_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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) {
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[ga]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 1]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 2]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 3]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 4]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 5]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 6]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[ga + 7]],
                                    VideoController.vcnPal16TS[0])]);
          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++;
            XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[ga]],
                                  VideoController.vcnPal16TS[0])]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //H_A

  //================================================================================
  //I ($0005,$06xx,$0010)
  //  概要
  //    I  1024ドット256色1プレーン
  //    拡張なし
  //  手順
  //    1番目のカラー(0は黒)
  //  中間コード1
  //    ipc(i1p())
  //  中間コード2
  //    ipc(i1p())
  //  中間コード3
  //    ipc(i1p())
  //  中間コード4
  //    ipc(i1p())
  //  中間コード5
  //    ipc(i1p())
  //  中間コード6
  //    ipo(i1p())
  I {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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) {
          XEiJ.pnlBM[da] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                        GraphicScreen.graM4[ga])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048577] << 4 |
                                                            GraphicScreen.graM4[ga + 1])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048578] << 4 |
                                                            GraphicScreen.graM4[ga + 2])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048579] << 4 |
                                                            GraphicScreen.graM4[ga + 3])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048580] << 4 |
                                                            GraphicScreen.graM4[ga + 4])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048581] << 4 |
                                                            GraphicScreen.graM4[ga + 5])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048582] << 4 |
                                                            GraphicScreen.graM4[ga + 6])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048583] << 4 |
                                                            GraphicScreen.graM4[ga + 7])]);
          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++;
            XEiJ.pnlBM[da] = (VideoController.vcnPal32G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                          GraphicScreen.graM4[ga])]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //I

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

  //================================================================================
  //I_XWP ($0005,$06xx,$1410)
  //  概要
  //    I  1024ドット256色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):ipc(tev(i1p())))
  //  中間コード2
  //    i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):ipc(tev(i1p()))
  //  中間コード3
  //    (v0=i1p())<=1?ipc(0):ls1(v0)==0?ipc(v0):ipc(tev(v0))
  //  中間コード4
  //    (p=i1p())<=1?ipc(0):ls1(p)==0?ipc(p):ipc(tev(p))
  //  中間コード5
  //    (p=i1p())<=1?ipc(0):(p&1)==0?ipc(p):ipc(p&-2)
  //  中間コード6
  //    (p=i1p())<=1?ipo(0):(p&1)==0?ipo(p):ipo(p&-2)
  I_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                  GraphicScreen.graM4[ga])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                      GraphicScreen.graM4[ga + 1])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                      GraphicScreen.graM4[ga + 2])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                      GraphicScreen.graM4[ga + 3])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                      GraphicScreen.graM4[ga + 4])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                      GraphicScreen.graM4[ga + 5])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                      GraphicScreen.graM4[ga + 6])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                      GraphicScreen.graM4[ga + 7])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          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 = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //I_XWP

  //================================================================================
  //I_XHCT ($0005,$06xx,$1910)
  //  概要
  //    I  1024ドット256色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p()))
  //  中間コード2
  //    ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p())
  //  中間コード3
  //    ls1(ipc(tev(v3=i1p())))!=0?mix(ipc(v3),0):ipc(v3)
  //  中間コード4
  //    ls1(ipc(tev(p=i1p())))!=0?mix(ipc(p),0):ipc(p)
  //  中間コード5
  //    (ipc((p=i1p())&-2)&1)!=0?mix(ipc(p),0):ipc(p)
  //  中間コード6
  //    (ipc((p=i1p())&-2)&1)!=0?cto(mix(ipc(p),0)):ipo(p)
  I_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                              GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                  GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                  GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                  GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                  GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                  GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                  GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                  GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          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] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //I_XHCT

  //================================================================================
  //I_XHPT ($0005,$06xx,$1D10)
  //  概要
  //    I  1024ドット256色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0))
  //  中間コード2
  //    i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0)
  //  中間コード3
  //    (v0=i1p())<=1?ipc(0):ls1(v0)==0?ipc(v0):mix(ipc(tev(v0)),0)
  //  中間コード4
  //    (p=i1p())<=1?ipc(0):ls1(p)==0?ipc(p):mix(ipc(tev(p)),0)
  //  中間コード5
  //    (p=i1p())<=1?ipc(0):(p&1)==0?ipc(p):mix(ipc(p&-2),0)
  //  中間コード6
  //    (p=i1p())<=1?ipo(0):(p&1)==0?ipo(p):cto(mix(ipc(p&-2),0))
  I_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                  GraphicScreen.graM4[ga])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                      GraphicScreen.graM4[ga + 1])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                      GraphicScreen.graM4[ga + 2])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                      GraphicScreen.graM4[ga + 3])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                      GraphicScreen.graM4[ga + 4])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                      GraphicScreen.graM4[ga + 5])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                      GraphicScreen.graM4[ga + 6])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                      GraphicScreen.graM4[ga + 7])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          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 = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //I_XHPT

  //================================================================================
  //I_A ($0005,$06xx,$4010)
  //  概要
  //    I  1024ドット256色1プレーン
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(ipc(i1p()),tpc(0))
  //  中間コード2
  //    mix(ipc(i1p()),tpc(0))
  //  中間コード3
  //    mix(ipc(i1p()),tpc(0))
  //  中間コード4
  //    mix(ipc(i1p()),tpc(0))
  //  中間コード5
  //    mix(ipc(i1p()),tpc(0))
  //  中間コード6
  //    cto(mix(ipc(i1p()),tpc(0)))
  I_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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) {
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                            GraphicScreen.graM4[ga])],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                GraphicScreen.graM4[ga + 1])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                GraphicScreen.graM4[ga + 2])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                GraphicScreen.graM4[ga + 3])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                GraphicScreen.graM4[ga + 4])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                GraphicScreen.graM4[ga + 5])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                GraphicScreen.graM4[ga + 6])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                GraphicScreen.graM4[ga + 7])],
                                    VideoController.vcnPal16TS[0])]);
          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++;
            XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[ga + 1048576] << 4 |
                                                              GraphicScreen.graM4[ga])],
                                  VideoController.vcnPal16TS[0])]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //I_A

  //================================================================================
  //J ($0007,$06xx,$0010)
  //  概要
  //    J  1024ドット65536色1プレーン
  //    拡張なし
  //  手順
  //    1番目のカラー(0は黒)
  //  中間コード1
  //    jpc(j1p(),j1p())
  //  中間コード2
  //    jpc(j1p(),j1p())
  //  中間コード3
  //    jpc(v1=j1p(),v1)
  //  中間コード4
  //    jpc(p=j1p(),p)
  //  中間コード5
  //    jpc(p=j1p(),p)
  //  中間コード6
  //    jpo(p=j1p(),p)
  J {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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] = (VideoController.vcnPalTbl[
                              VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                GraphicScreen.graM4[ga])) >> 8] |
                              VideoController.vcnPal8G16L[p & 255]]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                    GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                    GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                    GraphicScreen.graM4[ga + 1])) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                    GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                    GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                    GraphicScreen.graM4[ga + 2])) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                    GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                    GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                    GraphicScreen.graM4[ga + 3])) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                    GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                    GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                    GraphicScreen.graM4[ga + 4])) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                    GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                    GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                    GraphicScreen.graM4[ga + 5])) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                    GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                    GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                    GraphicScreen.graM4[ga + 6])) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                    GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                    GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                    GraphicScreen.graM4[ga + 7])) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]]);
          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] = (VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                  GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                  GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                  GraphicScreen.graM4[ga])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //J

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

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

  //================================================================================
  //J_XHCT ($0007,$06xx,$1910)
  //  概要
  //    J  1024ドット65536色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
  //      1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p()))
  //  中間コード2
  //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p())
  //  中間コード3
  //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?mix(jpc(v3,v3),0):jpc(v3,v3)
  //  中間コード4
  //    ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),0):jpc(q,q)
  //  中間コード5
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),0):jpc(q,q)
  //  中間コード6
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),0)):jpo(q,q)
  J_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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]),
                                0)] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnPal8G16H[q >> 8] |
                              VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                         GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                         GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                         GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                         GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                         GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                         GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                         GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          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]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //J_XHCT

  //================================================================================
  //J_XHPT ($0007,$06xx,$1D10)
  //  概要
  //    J  1024ドット65536色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0))
  //  中間コード2
  //    j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0)
  //  中間コード3
  //    (v0=j1p())<=1?jpc(0,0):ls1(v0)==0?jpc(v0,v0):mix(jpc(v6=tev(v0),v6),0)
  //  中間コード4
  //    (p=j1p())<=1?jpc(0,0):ls1(p)==0?jpc(p,p):mix(jpc(q=tev(p),q),0)
  //  中間コード5
  //    (p=j1p())<=1?jpc(0,0):(p&1)==0?jpc(p,p):mix(jpc(q=p&-2,q),0)
  //  中間コード6
  //    (p=j1p())<=1?jpo(0,0):(p&1)==0?jpo(p,p):cto(mix(jpc(q=p&-2,q),0))
  J_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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;
        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 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnPal8G16H[0 >> 8] |
                              VideoController.vcnPal8G16L[0 & 255]] :
                            (p & 1) == 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnPal8G16H[p >> 8] |
                              VideoController.vcnPal8G16L[p & 255]] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                 VideoController.vcnPal8G16L[q & 255]),
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                      GraphicScreen.graM4[ga + 2097153] << 8 |
                                      GraphicScreen.graM4[ga + 1048577] << 4 |
                                      GraphicScreen.graM4[ga + 1])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                      GraphicScreen.graM4[ga + 2097154] << 8 |
                                      GraphicScreen.graM4[ga + 1048578] << 4 |
                                      GraphicScreen.graM4[ga + 2])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                      GraphicScreen.graM4[ga + 2097155] << 8 |
                                      GraphicScreen.graM4[ga + 1048579] << 4 |
                                      GraphicScreen.graM4[ga + 3])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                      GraphicScreen.graM4[ga + 2097156] << 8 |
                                      GraphicScreen.graM4[ga + 1048580] << 4 |
                                      GraphicScreen.graM4[ga + 4])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                      GraphicScreen.graM4[ga + 2097157] << 8 |
                                      GraphicScreen.graM4[ga + 1048581] << 4 |
                                      GraphicScreen.graM4[ga + 5])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                      GraphicScreen.graM4[ga + 2097158] << 8 |
                                      GraphicScreen.graM4[ga + 1048582] << 4 |
                                      GraphicScreen.graM4[ga + 6])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                      GraphicScreen.graM4[ga + 2097159] << 8 |
                                      GraphicScreen.graM4[ga + 1048583] << 4 |
                                      GraphicScreen.graM4[ga + 7])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)]);
          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 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //J_XHPT

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

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

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

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

  //================================================================================
  //E1S_XWP ($0000,$18xx,$1441)
  //  概要
  //    E1S  512ドット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
  //    (e1p()<=1?(epc(0)!=0?epc(0):spc(spp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(spp())):epc(tev(e1p())))
  //  中間コード2
  //    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())<=1?(v1=epc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:spc(spp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:spc(spp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:spc(spp()):(p&1)==0?(q=epc(p))!=0?q:spc(spp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):spo(spp()):epo(p&-2)
  E1S_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                          (p = VideoController.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]) <= 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]) <= 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]) <= 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]) <= 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]) <= 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]) <= 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]) <= 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1S_XWP

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

  //================================================================================
  //E1S_XHCG ($0000,$18xx,$1A41)
  //  概要
  //    E1S  512ドット16色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(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()))))
  //  中間コード2
  //    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())
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(v1,epc(tod(e2q()))):ls1(v3)!=0?(v9=epc(tod(e2q())))!=0?v9:spc(spp()):(v14=epc(v3))!=0?v14:spc(spp())
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(spp()):(p=epc(q))!=0?cto(p):spo(spp())
  E1S_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              p,
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                          (q & 1) != 0 ?
                          (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 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[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1S_XHCG

  //================================================================================
  //E1S_XHCGT ($0000,$18xx,$1B41)
  //  概要
  //    E1S  512ドット16色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(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()))))
  //  中間コード2
  //    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())
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(mix(v1,epc(tod(e2q()))),spc(spp())):ls1(v3)!=0?(v12=epc(tod(e2q())))!=0?v12:spc(spp()):(v17=epc(v3))!=0?v17:spc(spp())
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),spc(spp())):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),spc(spp())):(q&1)!=0?(p=epc(e2q()|1))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),spc(spp()))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(spp()):(p=epc(q))!=0?cto(p):spo(spp())
  E1S_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                              VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                          (q & 1) != 0 ?
                          (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 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[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                              (q & 1) != 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1S_XHCGT

  //================================================================================
  //E1S_XHPT ($0000,$18xx,$1D41)
  //  概要
  //    E1S  512ドット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
  //    (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()<=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())<=1?(v1=epc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:spc(spp()):mix(epc(tev(v0)),spc(spp()))
  //  中間コード4
  //    (p=e1p())<=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())<=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())<=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())))
  E1S_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = 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[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[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[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[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[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[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[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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1S_XHPT

  //================================================================================
  //E1S_XHPG ($0000,$18xx,$1E41)
  //  概要
  //    E1S  512ドット16色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
  //    (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()<=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())<=1?(v1=epc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:spc(spp()):(v8=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v8:spc(spp())
  //  中間コード4
  //    (p=e1p())<=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())<=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())<=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())
  E1S_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = 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[gz2nd | gx2nd & 511] | 1])) != 0 ?
                          VideoController.vcnPalTbl[q] :
                          VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
        XEiJ.pnlBM[da + 1] = ((p = 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[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]) <= 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]) <= 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]) <= 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]) <= 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]) <= 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]) <= 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1S_XHPG

  //================================================================================
  //E1S_XHPGT ($0000,$18xx,$1F41)
  //  概要
  //    E1S  512ドット16色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
  //    (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()<=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())<=1?(v1=epc(0))!=0?v1:spc(spp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:spc(spp()):mix(mix(epc(tev(v0)),epc(tod(e2q()))),spc(spp()))
  //  中間コード4
  //    (p=e1p())<=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())<=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())<=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())))
  E1S_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = 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[gz2nd | gx2nd & 511] | 1]),
                              VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
        XEiJ.pnlBM[da + 1] = ((p = 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[gz2nd | gx2nd + 1 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
        XEiJ.pnlBM[da + 2] = ((p = 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[gz2nd | gx2nd + 2 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
        XEiJ.pnlBM[da + 3] = ((p = 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[gz2nd | gx2nd + 3 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
        XEiJ.pnlBM[da + 4] = ((p = 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[gz2nd | gx2nd + 4 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
        XEiJ.pnlBM[da + 5] = ((p = 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[gz2nd | gx2nd + 5 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
        XEiJ.pnlBM[da + 6] = ((p = 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[gz2nd | gx2nd + 6 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
        XEiJ.pnlBM[da + 7] = ((p = 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[gz2nd | gx2nd + 7 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E1S_XHPGT

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

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

  //================================================================================
  //E2S_XWC ($0000,$18xx,$1043)
  //  概要
  //    E2S  512ドット16色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
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):spc(spp()))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):spc(spp()))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(spp()):ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:spc(spp()):ls1(epc(tev(v11=e2p())))!=0?epc(v11):(v13=epc(v11))!=0?v13:spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:spc(spp()):ls1(epc(tev(p=e2p())))!=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()):(epc((p=e2p())&-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()):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):spo(spp())
  E2S_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                          (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                          VideoController.vcnPal32G8[p] :
                          (q = VideoController.vcnPal16G8[p]) != 0 ?
                          VideoController.vcnPalTbl[q] :
                          VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                          (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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
  },  //E2S_XWC

  //================================================================================
  //E2S_XWP ($0000,$18xx,$1443)
  //  概要
  //    E2S  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):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?epc(tev(e2p()))!=0?epc(tev(e2p())):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=epc(tev(e2p())))!=0?v1:spc(spp()):v0==1?(v6=epc(0))!=0?v6:spc(spp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:spc(spp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=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=epc(e2p()&-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=epc(e2p()&-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)
  E2S_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                          (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2S_XWP

  //================================================================================
  //E2S_XHCT ($0000,$18xx,$1943)
  //  概要
  //    E2S  512ドット16色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
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(spp())):(epc(e1p())!=0?epc(e1p()):spc(spp()))):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(spp())):(epc(e2p())!=0?epc(e2p()):spc(spp()))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(spp())):epc(e1p())!=0?epc(e1p()):spc(spp()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(spp())):epc(e2p())!=0?epc(e2p()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),spc(spp())):(v8=epc(v0))!=0?v8:spc(spp()):ls1(epc(tev(v14=e2p())))!=0?mix(epc(v14),spc(spp())):(v19=epc(v14))!=0?v19:spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(spp())):(q=epc(p))!=0?q:spc(spp()):ls1(epc(tev(p=e2p())))!=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()):(epc((p=e2p())&-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()):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),spc(spp()))):(q=epc(p))!=0?cto(q):spo(spp())
  E2S_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, 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]] :
                          (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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]] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 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
  },  //E2S_XHCT

  //================================================================================
  //E2S_XHCG ($0000,$18xx,$1A43)
  //  概要
  //    E2S  512ドット16色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
  //    (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())))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):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()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):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()):ls1(v18=epc(tev(v20=e2p())))!=0?mix(v18,epc(tod(e2q()))):(v25=epc(v20))!=0?v25: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()):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):(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=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(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=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(p=epc(q))!=0?cto(p):spo(spp())
  E2S_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              p,
                              VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                          (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                              (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                              (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                              (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                              (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                              (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                              (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                              (p = VideoController.vcnPal16G8[q]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2S_XHCG

  //================================================================================
  //E2S_XHCGT ($0000,$18xx,$1B43)
  //  概要
  //    E2S  512ドット16色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
  //    (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())))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(spp())):(epc(e2p())!=0?epc(e2p()):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()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(spp())):epc(e2p())!=0?epc(e2p()):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()):ls1(v21=epc(tev(v23=e2p())))!=0?mix(mix(v21,epc(tod(e2q()))),spc(spp())):(v31=epc(v23))!=0?v31: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()):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),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=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),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=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),spc(spp()))):(p=epc(q))!=0?cto(p):spo(spp())
  E2S_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                              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[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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                  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[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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                  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[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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                  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[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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                  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[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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                  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[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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                  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[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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                  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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2S_XHCGT

  //================================================================================
  //E2S_XHPT ($0000,$18xx,$1D43)
  //  概要
  //    E2S  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):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?epc(tev(e2p()))!=0?epc(tev(e2p())):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=epc(tev(e2p())))!=0?v1:spc(spp()):v0==1?(v6=epc(0))!=0?v6:spc(spp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:spc(spp()):mix(epc(tev(v0)),spc(spp()))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=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=epc(e2p()&-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=epc(e2p()&-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())))
  E2S_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                          (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2S_XHPT

  //================================================================================
  //E2S_XHPG ($0000,$18xx,$1E43)
  //  概要
  //    E2S  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):spc(spp())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):spc(spp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:spc(spp()):v0==1?(v6=epc(0))!=0?v6:spc(spp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:spc(spp()):(v13=mix(epc(tev(v0)),epc(tod(e2p()))))!=0?v13:spc(spp())
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=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(e2p()))))!=0?q:spc(spp())
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)))!=0?q:spc(spp())
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)))!=0?cto(q):spo(spp())
  E2S_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                          (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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[gy2nd | 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | 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 = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2S_XHPG

  //================================================================================
  //E2S_XHPGT ($0000,$18xx,$1F43)
  //  概要
  //    E2S  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p()))),spc(spp())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p()))),spc(spp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:spc(spp()):v0==1?(v6=epc(0))!=0?v6:spc(spp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:spc(spp()):mix(mix(epc(tev(v0)),epc(tod(e2p()))),spc(spp()))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=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(e2p()))),spc(spp()))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)),spc(spp()))
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)),spc(spp())))
  E2S_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                          (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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[gy2nd | gx2nd & 511] | 1]),
                              VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
        XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 1 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
        XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 2 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
        XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 3 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
        XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 4 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
        XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 5 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
        XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 6 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
        XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 7 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E2S_XHPGT

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

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

  //================================================================================
  //E3S_XWC ($0000,$18xx,$1047)
  //  概要
  //    E3S  512ドット16色3プレーン＞スプライト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが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()))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(epc(e3p())!=0?epc(e3p()):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()):ls1(epc(tev(e3p())))!=0?epc(e3p()):epc(e3p())!=0?epc(e3p()):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()):ls1(epc(tev(v19=e3p())))!=0?epc(v19):(v21=epc(v19))!=0?v21: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()):ls1(epc(tev(p=e3p())))!=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()):(epc((p=e3p())&-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()):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):spo(spp())
  E3S_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                          (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                          VideoController.vcnPal32G8[p] :
                          (q = VideoController.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]] :
                          (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3S_XWC

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

  //================================================================================
  //E3S_XHCT ($0000,$18xx,$1947)
  //  概要
  //    E3S  512ドット16色3プレーン＞スプライト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラーと
  //            スプライトカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが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()))):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(spp())):(epc(e3p())!=0?epc(e3p()):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()):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(spp())):epc(e3p())!=0?epc(e3p()):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()):ls1(epc(tev(v25=e3p())))!=0?mix(epc(v25),spc(spp())):(v30=epc(v25))!=0?v30: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()):ls1(epc(tev(p=e3p())))!=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()):(epc((p=e3p())&-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()):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),spc(spp()))):(q=epc(p))!=0?cto(q):spo(spp())
  E3S_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p, 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]] :
                          (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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[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]] :
                              (VideoController.vcnPal16G8[(p = 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3S_XHCT

  //================================================================================
  //E3S_XHCG ($0000,$18xx,$1A47)
  //  概要
  //    E3S  512ドット16色3プレーン＞スプライト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              スプライトカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが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()))):(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()))))))
  //  中間コード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()):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())
  //  中間コード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()):ls1(v29=epc(tev(v31=e3p())))!=0?mix(v29,epc(1)):ls1(v31)!=0?(v35=epc(1))!=0?v35:spc(spp()):(v38=epc(v31))!=0?v38: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()):ls1(p=epc(tev(q=e3p())))!=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=epc((q=e3p())&-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=epc((q=e3p())&-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())
  E3S_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3S_XHCG

  //================================================================================
  //E3S_XHCGT ($0000,$18xx,$1B47)
  //  概要
  //    E3S  512ドット16色3プレーン＞スプライト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //            スプライトカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              スプライトカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが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()))):(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()))))))
  //  中間コード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()):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())
  //  中間コード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()):ls1(v35=epc(tev(v37=e3p())))!=0?mix(mix(v35,epc(1)),spc(spp())):ls1(v37)!=0?(v44=epc(1))!=0?v44:spc(spp()):(v47=epc(v37))!=0?v47: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()):ls1(p=epc(tev(q=e3p())))!=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=epc((q=e3p())&-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=epc((q=e3p())&-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())
  E3S_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p, q;
        XEiJ.pnlBM[da] = ((p = 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3S_XHCGT

  //================================================================================
  //E3S_XHPT ($0000,$18xx,$1D47)
  //  概要
  //    E3S  512ドット16色3プレーン＞スプライト
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが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())):(epc(tev(e3p()))!=0?epc(tev(e3p())):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()):epc(tev(e3p()))!=0?epc(tev(e3p())):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=epc(tev(e3p())))!=0?v6:spc(spp()):v0==1?(v11=epc(0))!=0?v11:spc(spp()):ls1(v0)==0?(v15=epc(v0))!=0?v15:spc(spp()):mix(epc(tev(v0)),spc(spp()))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(tev(e3p())))!=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=epc(e3p()&-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=epc(e3p()&-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())))
  E3S_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p, 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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3S_XHPT

  //================================================================================
  //E3S_XHPG ($0000,$18xx,$1E47)
  //  概要
  //    E3S  512ドット16色3プレーン＞スプライト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが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())):(epc(tev(e3p()))!=0?epc(tev(e3p())):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()):epc(tev(e3p()))!=0?epc(tev(e3p())):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=epc(tev(e3p())))!=0?v6:spc(spp()):v0==1?(v11=epc(0))!=0?v11:spc(spp()):ls1(v0)==0?(v15=epc(v0))!=0?v15:spc(spp()):(v18=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v18:spc(spp())
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(tev(e3p())))!=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=epc(e3p()&-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=epc(e3p()&-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())
  E3S_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p, 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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3S_XHPG

  //================================================================================
  //E3S_XHPGT ($0000,$18xx,$1F47)
  //  概要
  //    E3S  512ドット16色3プレーン＞スプライト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが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())):(epc(tev(e3p()))!=0?epc(tev(e3p())):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()):epc(tev(e3p()))!=0?epc(tev(e3p())):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=epc(tev(e3p())))!=0?v6:spc(spp()):v0==1?(v11=epc(0))!=0?v11:spc(spp()):ls1(v0)==0?(v15=epc(v0))!=0?v15: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=epc(tev(e3p())))!=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=epc(e3p()&-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=epc(e3p()&-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())))
  E3S_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        da += half;
      }
      while (da < db) {
        int p, 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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[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 = VideoController.vcnPal16G8[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[gz2nd | gx2nd + 7 & 511] | 1]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //E3S_XHPGT

  //================================================================================
  //E4S ($0000,$18xx,$004F)
  //  概要
  //    E4S  512ドット16色4プレーン＞スプライト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトカラー(0は黒)
  //    さもなくば(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
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):spc(spp())):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):spc(spp())):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):spc(spp())):(epc(e4p())!=0?epc(e4p()):spc(spp())))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?epc(e2p())!=0?epc(e2p()):spc(spp()):e3p()!=0?epc(e3p())!=0?epc(e3p()):spc(spp()):epc(e4p())!=0?epc(e4p()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:spc(spp()):(v4=e2p())!=0?(v5=epc(v4))!=0?v5:spc(spp()):(v8=e3p())!=0?(v9=epc(v8))!=0?v9:spc(spp()):(v12=epc(e4p()))!=0?v12:spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()))!=0?p:spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()))!=0?p:spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p())!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=epc(e4p()))!=0?cto(p):spo(spp())
  E4S {
    @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 ?
                          (q = VideoController.vcnPal16G8[p]) != 0 ?
                          VideoController.vcnPalTbl[q] :
                          VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                          (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                          (q = VideoController.vcnPal16G8[p]) != 0 ?
                          VideoController.vcnPalTbl[q] :
                          VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                          (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                          (q = VideoController.vcnPal16G8[p]) != 0 ?
                          VideoController.vcnPalTbl[q] :
                          VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                          (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                              (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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                              (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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                              (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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                              (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                              (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]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              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] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                      GraphicScreen.graM4[ga + 2097154] << 8 |
                                      GraphicScreen.graM4[ga + 1048578] << 4 |
                                      GraphicScreen.graM4[ga + 2])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                      GraphicScreen.graM4[ga + 2097155] << 8 |
                                      GraphicScreen.graM4[ga + 1048579] << 4 |
                                      GraphicScreen.graM4[ga + 3])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                      GraphicScreen.graM4[ga + 2097156] << 8 |
                                      GraphicScreen.graM4[ga + 1048580] << 4 |
                                      GraphicScreen.graM4[ga + 4])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                      GraphicScreen.graM4[ga + 2097157] << 8 |
                                      GraphicScreen.graM4[ga + 1048581] << 4 |
                                      GraphicScreen.graM4[ga + 5])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                      GraphicScreen.graM4[ga + 2097158] << 8 |
                                      GraphicScreen.graM4[ga + 1048582] << 4 |
                                      GraphicScreen.graM4[ga + 6])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                      GraphicScreen.graM4[ga + 2097159] << 8 |
                                      GraphicScreen.graM4[ga + 1048583] << 4 |
                                      GraphicScreen.graM4[ga + 7])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          for (int k = 0; k < 8; k++) {
            if ((gx & 511) == 0) {  //gxが512の倍数のとき
              ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
            }
            gx++;
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //JS_XHPT

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //SG ($0003,$06xx,$004F)
  //  概要
  //    SG  スプライト＞512ドット65536色1プレーン
  //    拡張なし
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):gpc(g1p(),g1p()))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):gpc(g1p(),g1p())
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:gpc(v3=g1p(),v3)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:gpc(p=g1p(),p)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:gpc(p=g1p(),p)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):gpo(p=g1p(),p)
  SG {
    @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;
        XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                          VideoController.vcnPalTbl[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 12 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                                              GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) >> 8] |
                            VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                                                  GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //SG

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

  //================================================================================
  //SG_XWC ($0003,$06xx,$104F)
  //  概要
  //    SG  スプライト＞512ドット65536色1プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(gpc(tod(g1p()),tod(g1p())))!=0?gpc(g1p(),g1p()):(spc(spp())!=0?spc(spp()):gpc(g1p(),g1p())))
  //  中間コード2
  //    ls1(gpc(tod(g1p()),tod(g1p())))!=0?gpc(g1p(),g1p()):spc(spp())!=0?spc(spp()):gpc(g1p(),g1p())
  //  中間コード3
  //    ls1(gpc(v2=tod(v3=g1p()),v2))!=0?gpc(v3,v3):(v5=spc(spp()))!=0?v5:gpc(v3,v3)
  //  中間コード4
  //    ls1(gpc(p=tod(q=g1p()),p))!=0?gpc(q,q):(p=spc(spp()))!=0?p:gpc(q,q)
  //  中間コード5
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?gpc(q,q):(p=spc(spp()))!=0?p:gpc(q,q)
  //  中間コード6
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?gpo(q,q):(p=spc(spp()))!=0?cto(p):gpo(q,q)
  SG_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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                          VideoController.vcnPalTbl[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[q >> 8] |
                            VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //SG_XWC

  //================================================================================
  //SG_XWP ($0003,$06xx,$144F)
  //  概要
  //    SG  スプライト＞512ドット65536色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (g1p()<=1?(spc(spp())!=0?spc(spp()):gpc(0,0)):ls1(g1p())==0?(spc(spp())!=0?spc(spp()):gpc(g1p(),g1p())):gpc(tev(g1p()),tev(g1p())))
  //  中間コード2
  //    g1p()<=1?spc(spp())!=0?spc(spp()):gpc(0,0):ls1(g1p())==0?spc(spp())!=0?spc(spp()):gpc(g1p(),g1p()):gpc(tev(g1p()),tev(g1p()))
  //  中間コード3
  //    (v0=g1p())<=1?(v1=spc(spp()))!=0?v1:gpc(0,0):ls1(v0)==0?(v5=spc(spp()))!=0?v5:gpc(v0,v0):gpc(v9=tev(v0),v9)
  //  中間コード4
  //    (p=g1p())<=1?(p=spc(spp()))!=0?p:gpc(0,0):ls1(p)==0?(q=spc(spp()))!=0?q:gpc(p,p):gpc(q=tev(p),q)
  //  中間コード5
  //    (p=g1p())<=1?(p=spc(spp()))!=0?p:gpc(0,0):(p&1)==0?(q=spc(spp()))!=0?q:gpc(p,p):gpc(q=p&-2,q)
  //  中間コード6
  //    (p=g1p())<=1?(p=spc(spp()))!=0?cto(p):gpo(0,0):(p&1)==0?(q=spc(spp()))!=0?cto(q):gpo(p,p):gpo(q=p&-2,q)
  SG_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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                          VideoController.vcnPalTbl[p] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[0 >> 8] |
                            VideoController.vcnPal8G16L[0 & 255]] :
                          (p & 1) == 0 ?
                          (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                          VideoController.vcnPalTbl[q] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[p >> 8] |
                            VideoController.vcnPal8G16L[p & 255]] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                            VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[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.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //SG_XWP

  //================================================================================
  //SG_XHCT ($0003,$06xx,$194F)
  //  概要
  //    SG  スプライト＞512ドット65536色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のパレットを奇数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):(ls1(gpc(tod(g1p()),tod(g1p())))!=0?mix(gpc(g1p(),g1p()),0):gpc(g1p(),g1p())))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):ls1(gpc(tod(g1p()),tod(g1p())))!=0?mix(gpc(g1p(),g1p()),0):gpc(g1p(),g1p())
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:ls1(gpc(v4=tod(v5=g1p()),v4))!=0?mix(gpc(v5,v5),0):gpc(v5,v5)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:ls1(gpc(p=tod(q=g1p()),p))!=0?mix(gpc(q,q),0):gpc(q,q)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:(gpc(p=(q=g1p())|1,p)&1)!=0?mix(gpc(q,q),0):gpc(q,q)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):(gpc(p=(q=g1p())|1,p)&1)!=0?cto(mix(gpc(q,q),0)):gpo(q,q)
  SG_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] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                          VideoController.vcnPalTbl[p] :
                          ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 12 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                                                   GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) | 1) >> 8] |
                            VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              (VideoController.vcnPal8G16H[q >> 8] |
                               VideoController.vcnPal8G16L[q & 255]),
                              0)] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[q >> 8] |
                            VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                                                       GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //SG_XHCT

  //================================================================================
  //SG_XHPT ($0003,$06xx,$1D4F)
  //  概要
  //    SG  スプライト＞512ドット65536色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):(g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0)))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):g1p()<=1?gpc(0,0):ls1(g1p())==0?gpc(g1p(),g1p()):mix(gpc(tev(g1p()),tev(g1p())),0)
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:(v2=g1p())<=1?gpc(0,0):ls1(v2)==0?gpc(v2,v2):mix(gpc(v8=tev(v2),v8),0)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:(p=g1p())<=1?gpc(0,0):ls1(p)==0?gpc(p,p):mix(gpc(q=tev(p),q),0)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:(p=g1p())<=1?gpc(0,0):(p&1)==0?gpc(p,p):mix(gpc(q=p&-2,q),0)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):(p=g1p())<=1?gpo(0,0):(p&1)==0?gpo(p,p):cto(mix(gpc(q=p&-2,q),0))
  SG_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 = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                          VideoController.vcnPalTbl[p] :
                          (p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 12 |
                                GraphicScreen.graM4[gy3rd | gx3rd & 511] << 8 |
                                GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[0 >> 8] |
                            VideoController.vcnPal8G16L[0 & 255]] :
                          (p & 1) == 0 ?
                          VideoController.vcnPalTbl[
                            VideoController.vcnPal8G16H[p >> 8] |
                            VideoController.vcnPal8G16L[p & 255]] :
                          VideoController.vcnPalTbl[
                            VideoController.vcnMix2 (
                              (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                               VideoController.vcnPal8G16L[q & 255]),
                              0)]);
        XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 12 |
                                    GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] << 8 |
                                    GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)]);
        sx += 8;
        gx1st += 8;
        gx2nd += 8;
        gx3rd += 8;
        gx4th += 8;
        da += 8;
      }  //while da<db
    }  //drawRaster
  },  //SG_XHPT

  //================================================================================
  //SH ($0004,$06xx,$0050)
  //  概要
  //    SH  スプライト＞1024ドット16色1プレーン
  //    拡張なし
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):hpc(h1p()))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):hpc(h1p())
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:hpc(h1p())
  //  中間コード4
  //    (p=spc(spp()))!=0?p:hpc(h1p())
  //  中間コード5
  //    (p=spc(spp()))!=0?p:hpc(h1p())
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):hpo(h1p())
  SH {
    @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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[ga]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[ga + 7]]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[GraphicScreen.graM4[ga]]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SH

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

  //================================================================================
  //SH_XWC ($0004,$06xx,$1050)
  //  概要
  //    SH  スプライト＞1024ドット16色1プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(hpc(tev(h1p())))!=0?hpc(h1p()):(spc(spp())!=0?spc(spp()):hpc(h1p())))
  //  中間コード2
  //    ls1(hpc(tev(h1p())))!=0?hpc(h1p()):spc(spp())!=0?spc(spp()):hpc(h1p())
  //  中間コード3
  //    ls1(hpc(tev(v3=h1p())))!=0?hpc(v3):(v5=spc(spp()))!=0?v5:hpc(v3)
  //  中間コード4
  //    ls1(hpc(tev(p=h1p())))!=0?hpc(p):(q=spc(spp()))!=0?q:hpc(p)
  //  中間コード5
  //    (hpc((p=h1p())&-2)&1)!=0?hpc(p):(q=spc(spp()))!=0?q:hpc(p)
  //  中間コード6
  //    (hpc((p=h1p())&-2)&1)!=0?hpo(p):(q=spc(spp()))!=0?cto(q):hpo(p)
  SH_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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 1]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 2]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 3]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SH_XWC

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

  //================================================================================
  //SH_XHCT ($0004,$06xx,$1950)
  //  概要
  //    SH  スプライト＞1024ドット16色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):(ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p())))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):ls1(hpc(tev(h1p())))!=0?mix(hpc(h1p()),0):hpc(h1p())
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:ls1(hpc(tev(v5=h1p())))!=0?mix(hpc(v5),0):hpc(v5)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:ls1(hpc(tev(p=h1p())))!=0?mix(hpc(p),0):hpc(p)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:(hpc((p=h1p())&-2)&1)!=0?mix(hpc(p),0):hpc(p)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):(hpc((p=h1p())&-2)&1)!=0?cto(mix(hpc(p),0)):hpo(p)
  SH_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;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 1]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 2]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 3]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 4]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 5]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 6]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga + 7]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[ga]) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SH_XHCT

  //================================================================================
  //SH_XHPT ($0004,$06xx,$1D50)
  //  概要
  //    SH  スプライト＞1024ドット16色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):(h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0)))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):h1p()<=1?hpc(0):ls1(h1p())==0?hpc(h1p()):mix(hpc(tev(h1p())),0)
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:(v2=h1p())<=1?hpc(0):ls1(v2)==0?hpc(v2):mix(hpc(tev(v2)),0)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:(p=h1p())<=1?hpc(0):ls1(p)==0?hpc(p):mix(hpc(tev(p)),0)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:(p=h1p())<=1?hpc(0):(p&1)==0?hpc(p):mix(hpc(p&-2),0)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):(p=h1p())<=1?hpo(0):(p&1)==0?hpo(p):cto(mix(hpc(p&-2),0))
  SH_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;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[ga]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[ga + 1]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[ga + 2]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[ga + 3]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[ga + 4]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[ga + 5]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[ga + 6]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[ga + 7]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = GraphicScreen.graM4[ga]) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SH_XHPT

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

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

  //================================================================================
  //SI_XWC ($0005,$06xx,$1050)
  //  概要
  //    SI  スプライト＞1024ドット256色1プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(ipc(tev(i1p())))!=0?ipc(i1p()):(spc(spp())!=0?spc(spp()):ipc(i1p())))
  //  中間コード2
  //    ls1(ipc(tev(i1p())))!=0?ipc(i1p()):spc(spp())!=0?spc(spp()):ipc(i1p())
  //  中間コード3
  //    ls1(ipc(tev(v3=i1p())))!=0?ipc(v3):(v5=spc(spp()))!=0?v5:ipc(v3)
  //  中間コード4
  //    ls1(ipc(tev(p=i1p())))!=0?ipc(p):(q=spc(spp()))!=0?q:ipc(p)
  //  中間コード5
  //    (ipc((p=i1p())&-2)&1)!=0?ipc(p):(q=spc(spp()))!=0?q:ipc(p)
  //  中間コード6
  //    (ipc((p=i1p())&-2)&1)!=0?ipo(p):(q=spc(spp()))!=0?cto(q):ipo(p)
  SI_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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                  GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                  GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                  GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                  GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                  GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                  GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                  GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SI_XWC

  //================================================================================
  //SI_XWP ($0005,$06xx,$1450)
  //  概要
  //    SI  スプライト＞1024ドット256色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (i1p()<=1?(spc(spp())!=0?spc(spp()):ipc(0)):ls1(i1p())==0?(spc(spp())!=0?spc(spp()):ipc(i1p())):ipc(tev(i1p())))
  //  中間コード2
  //    i1p()<=1?spc(spp())!=0?spc(spp()):ipc(0):ls1(i1p())==0?spc(spp())!=0?spc(spp()):ipc(i1p()):ipc(tev(i1p()))
  //  中間コード3
  //    (v0=i1p())<=1?(v1=spc(spp()))!=0?v1:ipc(0):ls1(v0)==0?(v5=spc(spp()))!=0?v5:ipc(v0):ipc(tev(v0))
  //  中間コード4
  //    (p=i1p())<=1?(p=spc(spp()))!=0?p:ipc(0):ls1(p)==0?(q=spc(spp()))!=0?q:ipc(p):ipc(tev(p))
  //  中間コード5
  //    (p=i1p())<=1?(p=spc(spp()))!=0?p:ipc(0):(p&1)==0?(q=spc(spp()))!=0?q:ipc(p):ipc(p&-2)
  //  中間コード6
  //    (p=i1p())<=1?(p=spc(spp()))!=0?cto(p):ipo(0):(p&1)==0?(q=spc(spp()))!=0?cto(q):ipo(p):ipo(p&-2)
  SI_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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                      GraphicScreen.graM4[ga + 1])) <= 1 ?
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                      GraphicScreen.graM4[ga + 2])) <= 1 ?
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                      GraphicScreen.graM4[ga + 3])) <= 1 ?
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                      GraphicScreen.graM4[ga + 4])) <= 1 ?
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                      GraphicScreen.graM4[ga + 5])) <= 1 ?
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                      GraphicScreen.graM4[ga + 6])) <= 1 ?
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                      GraphicScreen.graM4[ga + 7])) <= 1 ?
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPal32G8[p & -2]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SI_XWP

  //================================================================================
  //SI_XHCT ($0005,$06xx,$1950)
  //  概要
  //    SI  スプライト＞1024ドット256色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):(ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p())))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),0):ipc(i1p())
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:ls1(ipc(tev(v5=i1p())))!=0?mix(ipc(v5),0):ipc(v5)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:ls1(ipc(tev(p=i1p())))!=0?mix(ipc(p),0):ipc(p)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:(ipc((p=i1p())&-2)&1)!=0?mix(ipc(p),0):ipc(p)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):(ipc((p=i1p())&-2)&1)!=0?cto(mix(ipc(p),0)):ipo(p)
  SI_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;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                              GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                  GraphicScreen.graM4[ga + 1])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                  GraphicScreen.graM4[ga + 2])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                  GraphicScreen.graM4[ga + 3])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                  GraphicScreen.graM4[ga + 4])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                  GraphicScreen.graM4[ga + 5])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                  GraphicScreen.graM4[ga + 6])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                  GraphicScreen.graM4[ga + 7])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  0)] :
                              VideoController.vcnPal32G8[p]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SI_XHCT

  //================================================================================
  //SI_XHPT ($0005,$06xx,$1D50)
  //  概要
  //    SI  スプライト＞1024ドット256色1プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):(i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0)))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):i1p()<=1?ipc(0):ls1(i1p())==0?ipc(i1p()):mix(ipc(tev(i1p())),0)
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:(v2=i1p())<=1?ipc(0):ls1(v2)==0?ipc(v2):mix(ipc(tev(v2)),0)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:(p=i1p())<=1?ipc(0):ls1(p)==0?ipc(p):mix(ipc(tev(p)),0)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:(p=i1p())<=1?ipc(0):(p&1)==0?ipc(p):mix(ipc(p&-2),0)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):(p=i1p())<=1?ipo(0):(p&1)==0?ipo(p):cto(mix(ipc(p&-2),0))
  SI_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;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                  GraphicScreen.graM4[ga])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = (GraphicScreen.graM4[ga + 1048577] << 4 |
                                      GraphicScreen.graM4[ga + 1])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = (GraphicScreen.graM4[ga + 1048578] << 4 |
                                      GraphicScreen.graM4[ga + 2])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = (GraphicScreen.graM4[ga + 1048579] << 4 |
                                      GraphicScreen.graM4[ga + 3])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = (GraphicScreen.graM4[ga + 1048580] << 4 |
                                      GraphicScreen.graM4[ga + 4])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = (GraphicScreen.graM4[ga + 1048581] << 4 |
                                      GraphicScreen.graM4[ga + 5])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = (GraphicScreen.graM4[ga + 1048582] << 4 |
                                      GraphicScreen.graM4[ga + 6])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = (GraphicScreen.graM4[ga + 1048583] << 4 |
                                      GraphicScreen.graM4[ga + 7])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              (p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              VideoController.vcnPal32G8[0] :
                              (p & 1) == 0 ?
                              VideoController.vcnPal32G8[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  0)]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SI_XHPT

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

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

  //================================================================================
  //SJ_XWC ($0007,$06xx,$1050)
  //  概要
  //    SJ  スプライト＞1024ドット65536色1プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを奇数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):(spc(spp())!=0?spc(spp()):jpc(j1p(),j1p())))
  //  中間コード2
  //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):spc(spp())!=0?spc(spp()):jpc(j1p(),j1p())
  //  中間コード3
  //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?jpc(v3,v3):(v5=spc(spp()))!=0?v5:jpc(v3,v3)
  //  中間コード4
  //    ls1(jpc(p=tod(q=j1p()),p))!=0?jpc(q,q):(p=spc(spp()))!=0?p:jpc(q,q)
  //  中間コード5
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpc(q,q):(p=spc(spp()))!=0?p:jpc(q,q)
  //  中間コード6
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpo(q,q):(p=spc(spp()))!=0?cto(p):jpo(q,q)
  SJ_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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnPal8G16H[q >> 8] |
                              VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 1] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                         GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 2] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                         GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 3] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                         GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 4] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                         GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 5] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                         GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 6] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                         GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 7] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                         GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SJ_XWC

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

  //================================================================================
  //SJ_XHCT ($0007,$06xx,$1950)
  //  概要
  //    SJ  スプライト＞1024ドット65536色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトカラーが0でないとき
  //      スプライトカラー
  //    さもなくば(スプライトカラーが0のとき)
  //      1番目のパレットを奇数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを奇数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (spc(spp())!=0?spc(spp()):(ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p())))
  //  中間コード2
  //    spc(spp())!=0?spc(spp()):ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),0):jpc(j1p(),j1p())
  //  中間コード3
  //    (v0=spc(spp()))!=0?v0:ls1(jpc(v4=tod(v5=j1p()),v4))!=0?mix(jpc(v5,v5),0):jpc(v5,v5)
  //  中間コード4
  //    (p=spc(spp()))!=0?p:ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),0):jpc(q,q)
  //  中間コード5
  //    (p=spc(spp()))!=0?p:(jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),0):jpc(q,q)
  //  中間コード6
  //    (p=spc(spp()))!=0?cto(p):(jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),0)):jpo(q,q)
  SJ_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] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                     GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                     GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                     GraphicScreen.graM4[ga])) | 1) >> 8] |
                              VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                (VideoController.vcnPal8G16H[q >> 8] |
                                 VideoController.vcnPal8G16L[q & 255]),
                                0)] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnPal8G16H[q >> 8] |
                              VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                         GraphicScreen.graM4[ga + 1])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                         GraphicScreen.graM4[ga + 2])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                         GraphicScreen.graM4[ga + 3])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                         GraphicScreen.graM4[ga + 4])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                         GraphicScreen.graM4[ga + 5])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                         GraphicScreen.graM4[ga + 6])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                         GraphicScreen.graM4[ga + 7])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          sx += 8;
          ga += 8;
          da += 8;
        }  //while da<dc
        if (da < db) {
          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.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              ((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                       GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                       GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                       GraphicScreen.graM4[ga])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
            sx++;
            ga++;
            da++;
          }  //for k
        }  //if da<db
      }  //while da<db
    }  //drawRaster
  },  //SJ_XHCT

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

  //================================================================================
  //E1T ($0000,$09xx,$0021)
  //  概要
  //    E1T  512ドット16色1プレーン＞テキスト
  //    拡張なし
  //  手順
  //    1番目のカラーが0でないとき
  //      1番目のカラー
  //    さもなくば(1番目のカラーが0のとき)
  //      テキストカラー(0は黒)
  //  中間コード1
  //    (epc(e1p())!=0?epc(e1p()):tpc(txp()))
  //  中間コード2
  //    epc(e1p())!=0?epc(e1p()):tpc(txp())
  //  中間コード3
  //    (v0=epc(e1p()))!=0?v0:tpc(txp())
  //  中間コード4
  //    (p=epc(e1p()))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=epc(e1p()))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=epc(e1p()))!=0?cto(p):tpo(txp())
  E1T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T

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

  //================================================================================
  //E1T_XWC ($0000,$09xx,$1021)
  //  概要
  //    E1T  512ドット16色1プレーン＞テキスト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):tpc(txp())))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp())
  //  中間コード3
  //    ls1(epc(tev(v3=e1p())))!=0?epc(v3):(v5=epc(v3))!=0?v5:tpc(txp())
  //  中間コード4
  //    ls1(epc(tev(p=e1p())))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (epc((p=e1p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (epc((p=e1p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp())
  E1T_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XWC

  //================================================================================
  //E1T_XWP ($0000,$09xx,$1421)
  //  概要
  //    E1T  512ドット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
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):epc(tev(e1p())))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:tpc(txp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):epo(p&-2)
  E1T_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XWP

  //================================================================================
  //E1T_XHCT ($0000,$09xx,$1921)
  //  概要
  //    E1T  512ドット16色1プレーン＞テキスト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーと
  //        テキストカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):epc(e1p())!=0?epc(e1p()):tpc(txp())
  //  中間コード3
  //    ls1(epc(tev(v3=e1p())))!=0?mix(epc(v3),tpc(txp())):(v8=epc(v3))!=0?v8:tpc(txp())
  //  中間コード4
  //    ls1(epc(tev(p=e1p())))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (epc((p=e1p())&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp())
  E1T_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XHCT

  //================================================================================
  //E1T_XHCG ($0000,$09xx,$1A21)
  //  概要
  //    E1T  512ドット16色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(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp())
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(v1,epc(tod(e2q()))):ls1(v3)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(txp()):(v14=epc(v3))!=0?v14:tpc(txp())
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  E1T_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XHCG

  //================================================================================
  //E1T_XHCGT ($0000,$09xx,$1B21)
  //  概要
  //    E1T  512ドット16色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(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp())
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(mix(v1,epc(tod(e2q()))),tpc(txp())):ls1(v3)!=0?(v12=epc(tod(e2q())))!=0?v12:tpc(txp()):(v17=epc(v3))!=0?v17:tpc(txp())
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),tpc(txp())):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),tpc(txp())):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),tpc(txp()))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  E1T_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XHCGT

  //================================================================================
  //E1T_XHPT ($0000,$09xx,$1D21)
  //  概要
  //    E1T  512ドット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
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(epc(tev(e1p())),tpc(txp())))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),tpc(txp()))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:tpc(txp()):mix(epc(tev(v0)),tpc(txp()))
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(tev(p)),tpc(txp()))
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(p&-2),tpc(txp()))
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(epc(p&-2),tpc(txp())))
  E1T_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XHPT

  //================================================================================
  //E1T_XHPG ($0000,$09xx,$1E21)
  //  概要
  //    E1T  512ドット16色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
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:tpc(txp()):(v8=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v8:tpc(txp())
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(txp())
  E1T_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XHPG

  //================================================================================
  //E1T_XHPGT ($0000,$09xx,$1F21)
  //  概要
  //    E1T  512ドット16色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
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp()))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=epc(v0))!=0?v5:tpc(txp()):mix(mix(epc(tev(v0)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp()))
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp())))
  E1T_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1T_XHPGT

  //================================================================================
  //E2T ($0000,$09xx,$0023)
  //  概要
  //    E2T  512ドット16色2プレーン＞テキスト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーが0でないとき
  //        2番目のカラー
  //      さもなくば(2番目のカラーが0のとき)
  //        テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp())))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(e2p())!=0?epc(e2p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:tpc(txp()):(v4=epc(e2p()))!=0?v4:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e2p()))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e2p()))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e2p()))!=0?cto(p):tpo(txp())
  E2T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T

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

  //================================================================================
  //E2T_XWC ($0000,$09xx,$1023)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):tpc(txp()))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp()):ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:tpc(txp()):ls1(epc(tev(v11=e2p())))!=0?epc(v11):(v13=epc(v11))!=0?v13:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e2p())))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e2p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp())
  E2T_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XWC

  //================================================================================
  //E2T_XWP ($0000,$09xx,$1423)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(txp()):v0==1?(v6=epc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:tpc(txp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):epo(p&-2)
  E2T_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XWP

  //================================================================================
  //E2T_XHCT ($0000,$09xx,$1923)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):epc(e1p())!=0?epc(e1p()):tpc(txp()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),tpc(txp())):(v8=epc(v0))!=0?v8:tpc(txp()):ls1(epc(tev(v14=e2p())))!=0?mix(epc(v14),tpc(txp())):(v19=epc(v14))!=0?v19:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp())
  E2T_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XHCT

  //================================================================================
  //E2T_XHCG ($0000,$09xx,$1A23)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(txp()))))
  //  中間コード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())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(txp()):(v14=epc(v0))!=0?v14:tpc(txp()):ls1(v18=epc(tev(v20=e2p())))!=0?mix(v18,epc(tod(e2q()))):(v25=epc(v20))!=0?v25:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード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):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(p=epc(q))!=0?cto(p):tpo(txp())
  E2T_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XHCG

  //================================================================================
  //E2T_XHCGT ($0000,$09xx,$1B23)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),tpc(txp())):ls1(v0)!=0?(v12=epc(tod(e2q())))!=0?v12:tpc(txp()):(v17=epc(v0))!=0?v17:tpc(txp()):ls1(v21=epc(tev(v23=e2p())))!=0?mix(mix(v21,epc(tod(e2q()))),tpc(txp())):(v31=epc(v23))!=0?v31:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(txp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),tpc(txp())):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(txp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),tpc(txp())):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(txp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),tpc(txp()))):(p=epc(q))!=0?cto(p):tpo(txp())
  E2T_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XHCGT

  //================================================================================
  //E2T_XHPT ($0000,$09xx,$1D23)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(epc(tev(e1p())),tpc(txp())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(txp()):v0==1?(v6=epc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:tpc(txp()):mix(epc(tev(v0)),tpc(txp()))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(tev(p)),tpc(txp()))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(p&-2),tpc(txp()))
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(epc(p&-2),tpc(txp())))
  E2T_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XHPT

  //================================================================================
  //E2T_XHPG ($0000,$09xx,$1E23)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):tpc(txp())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):tpc(txp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(txp()):v0==1?(v6=epc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:tpc(txp()):(v13=mix(epc(tev(v0)),epc(tod(e2p()))))!=0?v13:tpc(txp())
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(tev(p)),epc(tod(e2p()))))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?cto(q):tpo(txp())
  E2T_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XHPG

  //================================================================================
  //E2T_XHPGT ($0000,$09xx,$1F23)
  //  概要
  //    E2T  512ドット16色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
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),tpc(txp())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(txp()):v0==1?(v6=epc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=epc(v0))!=0?v10:tpc(txp()):mix(mix(epc(tev(v0)),epc(tod(e2p()))),tpc(txp()))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(tev(p)),epc(tod(e2p()))),tpc(txp()))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(p&-2),epc(e2p()|1)),tpc(txp()))
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(epc(p&-2),epc(e2p()|1)),tpc(txp())))
  E2T_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2T_XHPGT

  //================================================================================
  //E3T ($0000,$09xx,$0027)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のカラーが0でないとき
  //          3番目のカラー
  //        さもなくば(3番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp()))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?epc(e2p())!=0?epc(e2p()):tpc(txp()):epc(e3p())!=0?epc(e3p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:tpc(txp()):(v4=e2p())!=0?(v5=epc(v4))!=0?v5:tpc(txp()):(v8=epc(e3p()))!=0?v8:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e3p()))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e3p()))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e3p()))!=0?cto(p):tpo(txp())
  E3T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T

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

  //================================================================================
  //E3T_XWC ($0000,$09xx,$1027)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(epc(e3p())!=0?epc(e3p()):tpc(txp())))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(txp()):ls1(epc(tev(e3p())))!=0?epc(e3p()):epc(e3p())!=0?epc(e3p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:tpc(txp()):(v8=e2p())!=0?ls1(epc(tev(v8)))!=0?epc(v8):(v13=epc(v8))!=0?v13:tpc(txp()):ls1(epc(tev(v19=e3p())))!=0?epc(v19):(v21=epc(v19))!=0?v21:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e3p())))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e3p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp())
  E3T_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (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[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (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[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T_XWC

  //================================================================================
  //E3T_XWP ($0000,$09xx,$1427)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが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())):tpc(txp())):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(txp()):(v6=epc(tev(e3p())))!=0?v6:tpc(txp()):v0==1?(v11=epc(0))!=0?v11:tpc(txp()):ls1(v0)==0?(v15=epc(v0))!=0?v15:tpc(txp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e3p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e3p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e3p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):epo(p&-2)
  E3T_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T_XWP

  //================================================================================
  //E3T_XHCT ($0000,$09xx,$1927)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラーと
  //            テキストカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp())))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp()):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(txp())):epc(e3p())!=0?epc(e3p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),tpc(txp())):(v8=epc(v0))!=0?v8:tpc(txp()):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?mix(epc(v11),tpc(txp())):(v19=epc(v11))!=0?v19:tpc(txp()):ls1(epc(tev(v25=e3p())))!=0?mix(epc(v25),tpc(txp())):(v30=epc(v25))!=0?v30:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp())
  E3T_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T_XHCT

  //================================================================================
  //E3T_XHCG ($0000,$09xx,$1A27)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              テキストカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが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())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp()))))))
  //  中間コード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())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(txp()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e3p())!=0?epc(e3p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(txp()):(v14=epc(v0))!=0?v14:tpc(txp()):(v17=e2p())!=0?ls1(v19=epc(tev(v17)))!=0?mix(v19,epc(tod(e2q()))):(v25=epc(v17))!=0?v25:tpc(txp()):ls1(v29=epc(tev(v31=e3p())))!=0?mix(v29,epc(1)):ls1(v31)!=0?(v35=epc(1))!=0?v35:tpc(txp()):(v38=epc(v31))!=0?v38:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード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):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  E3T_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T_XHCG

  //================================================================================
  //E3T_XHCGT ($0000,$09xx,$1B27)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //            テキストカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              テキストカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(txp())):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp()))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(txp())):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e3p())!=0?epc(e3p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),tpc(txp())):ls1(v0)!=0?(v12=epc(tod(e2q())))!=0?v12:tpc(txp()):(v17=epc(v0))!=0?v17:tpc(txp()):(v20=e2p())!=0?ls1(v22=epc(tev(v20)))!=0?mix(mix(v22,epc(tod(e2q()))),tpc(txp())):(v31=epc(v20))!=0?v31:tpc(txp()):ls1(v35=epc(tev(v37=e3p())))!=0?mix(mix(v35,epc(1)),tpc(txp())):ls1(v37)!=0?(v44=epc(1))!=0?v44:tpc(txp()):(v47=epc(v37))!=0?v47:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(txp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),tpc(txp())):ls1(q)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(txp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),tpc(txp())):(q&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(txp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),tpc(txp()))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  E3T_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T_XHCGT

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

  //================================================================================
  //E3T_XHPG ($0000,$09xx,$1E27)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが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())):tpc(txp())):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(txp()):(v6=epc(tev(e3p())))!=0?v6:tpc(txp()):v0==1?(v11=epc(0))!=0?v11:tpc(txp()):ls1(v0)==0?(v15=epc(v0))!=0?v15:tpc(txp()):(v18=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v18:tpc(txp())
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e3p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e3p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e3p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(txp())
  E3T_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T_XHPG

  //================================================================================
  //E3T_XHPGT ($0000,$09xx,$1F27)
  //  概要
  //    E3T  512ドット16色3プレーン＞テキスト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが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())):tpc(txp())):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(txp()):(v6=epc(tev(e3p())))!=0?v6:tpc(txp()):v0==1?(v11=epc(0))!=0?v11:tpc(txp()):ls1(v0)==0?(v15=epc(v0))!=0?v15:tpc(txp()):mix(mix(epc(tev(v0)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e3p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e3p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp()))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e3p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp())))
  E3T_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3T_XHPGT

  //================================================================================
  //E4T ($0000,$09xx,$002F)
  //  概要
  //    E4T  512ドット16色4プレーン＞テキスト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストカラー(0は黒)
  //    さもなくば(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
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):tpc(txp())):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp())))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?epc(e3p())!=0?epc(e3p()):tpc(txp()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:tpc(txp()):(v4=e2p())!=0?(v5=epc(v4))!=0?v5:tpc(txp()):(v8=e3p())!=0?(v9=epc(v8))!=0?v9:tpc(txp()):(v12=epc(e4p()))!=0?v12:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()))!=0?cto(p):tpo(txp())
  E4T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T

  //================================================================================
  //XE4T
  //  概要
  //    E4T  512ドット16色4プレーン＞テキスト
  //    拡張あり
  XE4T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E4T_XWC
      case 0b00010001:  //E4T_XWC
      case 0b00010010:  //E4T_XWC
      case 0b00010011:  //E4T_XWC
        E4T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E4T_XWP
      case 0b00010101:  //E4T_XWP
      case 0b00010110:  //E4T_XWP
      case 0b00010111:  //E4T_XWP
        E4T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E4T_XHC
        E4T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E4T_XHCT
        E4T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E4T_XHCG
        E4T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E4T_XHCGT
        E4T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E4T_XHPT
        E4T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E4T_XHPG
        E4T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E4T_XHPGT
        E4T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E4T_A
      case 0b01000001:  //E4T_A
      case 0b01000010:  //E4T_A
      case 0b01000011:  //E4T_A
      case 0b01000100:  //E4T_A
      case 0b01000101:  //E4T_A
      case 0b01000110:  //E4T_A
      case 0b01000111:  //E4T_A
      case 0b01001000:  //E4T_A
      case 0b01001001:  //E4T_A
      case 0b01001010:  //E4T_A
      case 0b01001011:  //E4T_A
      case 0b01001100:  //E4T_A
      case 0b01001101:  //E4T_A
      case 0b01001110:  //E4T_A
      case 0b01001111:  //E4T_A
      case 0b01010000:  //E4T_A
      case 0b01010001:  //E4T_A
      case 0b01010010:  //E4T_A
      case 0b01010011:  //E4T_A
      case 0b01010100:  //E4T_A
      case 0b01010101:  //E4T_A
      case 0b01010110:  //E4T_A
      case 0b01010111:  //E4T_A
      case 0b01011000:  //E4T_A
      case 0b01011001:  //E4T_A
      case 0b01011010:  //E4T_A
      case 0b01011011:  //E4T_A
      case 0b01011100:  //E4T_A
      case 0b01011101:  //E4T_A
      case 0b01011110:  //E4T_A
      case 0b01011111:  //E4T_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        E4T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE4T);
      }  //switch
    }  //drawRaster
  },  //XE4T

  //================================================================================
  //E4T_XWC ($0000,$09xx,$102F)
  //  概要
  //    E4T  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()):tpc(txp()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(epc(e3p())!=0?epc(e3p()):tpc(txp()))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(epc(e4p())!=0?epc(e4p()):tpc(txp()))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?epc(e4p()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:tpc(txp()):(v8=e2p())!=0?ls1(epc(tev(v8)))!=0?epc(v8):(v13=epc(v8))!=0?v13:tpc(txp()):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?epc(v16):(v21=epc(v16))!=0?v21:tpc(txp()):ls1(epc(tev(v27=e4p())))!=0?epc(v27):(v29=epc(v27))!=0?v29:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):tpo(txp())
  E4T_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XWC

  //================================================================================
  //E4T_XWP ($0000,$09xx,$142F)
  //  概要
  //    E4T  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())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp())))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(txp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:tpc(txp()):(v11=epc(tev(e4p())))!=0?v11:tpc(txp()):v0==1?(v16=epc(0))!=0?v16:tpc(txp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:tpc(txp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):epo(p&-2)
  E4T_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XWP

  //================================================================================
  //E4T_XHCT ($0000,$09xx,$192F)
  //  概要
  //    E4T  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()),tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp()))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp()))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(txp())):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(txp())):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),tpc(txp())):(v8=epc(v0))!=0?v8:tpc(txp()):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?mix(epc(v11),tpc(txp())):(v19=epc(v11))!=0?v19:tpc(txp()):(v22=e3p())!=0?ls1(epc(tev(v22)))!=0?mix(epc(v22),tpc(txp())):(v30=epc(v22))!=0?v30:tpc(txp()):ls1(epc(tev(v36=e4p())))!=0?mix(epc(v36),tpc(txp())):(v41=epc(v36))!=0?v41:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp())
  E4T_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XHCT

  //================================================================================
  //E4T_XHCG ($0000,$09xx,$1A2F)
  //  概要
  //    E4T  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())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp())))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp())))))))
  //  中間コード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())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(txp()):(v14=epc(v0))!=0?v14:tpc(txp()):(v17=e2p())!=0?ls1(v19=epc(tev(v17)))!=0?mix(v19,epc(tod(e2q()))):(v25=epc(v17))!=0?v25:tpc(txp()):(v28=e3p())!=0?ls1(v30=epc(tev(v28)))!=0?mix(v30,epc(1)):ls1(v28)!=0?(v35=epc(1))!=0?v35:tpc(txp()):(v38=epc(v28))!=0?v38:tpc(txp()):ls1(v42=epc(tev(v44=e4p())))!=0?mix(v42,epc(1)):ls1(v44)!=0?(v48=epc(1))!=0?v48:tpc(txp()):(v51=epc(v44))!=0?v51:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード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):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  E4T_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XHCG

  //================================================================================
  //E4T_XHCGT ($0000,$09xx,$1B2F)
  //  概要
  //    E4T  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()))),tpc(txp())):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(txp())):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp())))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(txp())):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(txp())):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(txp())):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),tpc(txp())):ls1(v0)!=0?(v12=epc(tod(e2q())))!=0?v12:tpc(txp()):(v17=epc(v0))!=0?v17:tpc(txp()):(v20=e2p())!=0?ls1(v22=epc(tev(v20)))!=0?mix(mix(v22,epc(tod(e2q()))),tpc(txp())):(v31=epc(v20))!=0?v31:tpc(txp()):(v34=e3p())!=0?ls1(v36=epc(tev(v34)))!=0?mix(mix(v36,epc(1)),tpc(txp())):ls1(v34)!=0?(v44=epc(1))!=0?v44:tpc(txp()):(v47=epc(v34))!=0?v47:tpc(txp()):ls1(v51=epc(tev(v53=e4p())))!=0?mix(mix(v51,epc(1)),tpc(txp())):ls1(v53)!=0?(v60=epc(1))!=0?v60:tpc(txp()):(v63=epc(v53))!=0?v63:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(txp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),tpc(txp())):ls1(p)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),tpc(txp())):ls1(q)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(txp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),tpc(txp())):(p&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),tpc(txp())):(q&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(txp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),tpc(txp()))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),tpc(txp()))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  E4T_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XHCGT

  //================================================================================
  //E4T_XHPT ($0000,$09xx,$1D2F)
  //  概要
  //    E4T  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())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp())))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(epc(tev(e1p())),tpc(txp())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(txp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:tpc(txp()):(v11=epc(tev(e4p())))!=0?v11:tpc(txp()):v0==1?(v16=epc(0))!=0?v16:tpc(txp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:tpc(txp()):mix(epc(tev(v0)),tpc(txp()))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(tev(p)),tpc(txp()))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(p&-2),tpc(txp()))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(epc(p&-2),tpc(txp())))
  E4T_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XHPT

  //================================================================================
  //E4T_XHPG ($0000,$09xx,$1E2F)
  //  概要
  //    E4T  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())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp())))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(txp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:tpc(txp()):(v11=epc(tev(e4p())))!=0?v11:tpc(txp()):v0==1?(v16=epc(0))!=0?v16:tpc(txp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:tpc(txp()):(v23=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v23:tpc(txp())
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(txp())
  E4T_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XHPG

  //================================================================================
  //E4T_XHPGT ($0000,$09xx,$1F2F)
  //  概要
  //    E4T  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())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp())))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(txp()):(v6=tev(e3p()))!=0?(v8=epc(v6))!=0?v8:tpc(txp()):(v11=epc(tev(e4p())))!=0?v11:tpc(txp()):v0==1?(v16=epc(0))!=0?v16:tpc(txp()):ls1(v0)==0?(v20=epc(v0))!=0?v20:tpc(txp()):mix(mix(epc(tev(v0)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp()))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp())))
  E4T_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int 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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4T_XHPGT

  //================================================================================
  //F1T ($0001,$09xx,$0023)
  //  概要
  //    F1T  512ドット256色1プレーン＞テキスト
  //    拡張なし
  //  手順
  //    1番目のカラーが0でないとき
  //      1番目のカラー
  //    さもなくば(1番目のカラーが0のとき)
  //      テキストカラー(0は黒)
  //  中間コード1
  //    (fpc(f1p())!=0?fpc(f1p()):tpc(txp()))
  //  中間コード2
  //    fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    (v0=fpc(f1p()))!=0?v0:tpc(txp())
  //  中間コード4
  //    (p=fpc(f1p()))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=fpc(f1p()))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=fpc(f1p()))!=0?cto(p):tpo(txp())
  F1T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15]);
          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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15]);
          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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T

  //================================================================================
  //XF1T
  //  概要
  //    F1T  512ドット256色1プレーン＞テキスト
  //    拡張あり
  XF1T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F1T_XWC
      case 0b00010001:  //F1T_XWC
      case 0b00010010:  //F1T_XWC
      case 0b00010011:  //F1T_XWC
        F1T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F1T_XWP
      case 0b00010101:  //F1T_XWP
      case 0b00010110:  //F1T_XWP
      case 0b00010111:  //F1T_XWP
        F1T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F1T_XHC
        F1T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F1T_XHCT
        F1T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F1T_XHCG
        F1T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F1T_XHCGT
        F1T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F1T_XHPT
        F1T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F1T_XHPG
        F1T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F1T_XHPGT
        F1T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F1T_A
      case 0b01000001:  //F1T_A
      case 0b01000010:  //F1T_A
      case 0b01000011:  //F1T_A
      case 0b01000100:  //F1T_A
      case 0b01000101:  //F1T_A
      case 0b01000110:  //F1T_A
      case 0b01000111:  //F1T_A
      case 0b01001000:  //F1T_A
      case 0b01001001:  //F1T_A
      case 0b01001010:  //F1T_A
      case 0b01001011:  //F1T_A
      case 0b01001100:  //F1T_A
      case 0b01001101:  //F1T_A
      case 0b01001110:  //F1T_A
      case 0b01001111:  //F1T_A
      case 0b01010000:  //F1T_A
      case 0b01010001:  //F1T_A
      case 0b01010010:  //F1T_A
      case 0b01010011:  //F1T_A
      case 0b01010100:  //F1T_A
      case 0b01010101:  //F1T_A
      case 0b01010110:  //F1T_A
      case 0b01010111:  //F1T_A
      case 0b01011000:  //F1T_A
      case 0b01011001:  //F1T_A
      case 0b01011010:  //F1T_A
      case 0b01011011:  //F1T_A
      case 0b01011100:  //F1T_A
      case 0b01011101:  //F1T_A
      case 0b01011110:  //F1T_A
      case 0b01011111:  //F1T_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        F1T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF1T);
      }  //switch
    }  //drawRaster
  },  //XF1T

  //================================================================================
  //F1T_XWC ($0001,$09xx,$1023)
  //  概要
  //    F1T  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()):tpc(txp())))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=fpc(v3))!=0?v5:tpc(txp())
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp())
  F1T_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((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[tp >>> 28]);
          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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15]);
          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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((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[tp >>> 28]);
          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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15]);
          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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XWC

  //================================================================================
  //F1T_XWP ($0001,$09xx,$1423)
  //  概要
  //    F1T  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):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:tpc(txp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):fpo(p&-2)
  F1T_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XWP

  //================================================================================
  //F1T_XHCT ($0001,$09xx,$1923)
  //  概要
  //    F1T  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()),tpc(txp())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp())))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(txp())):fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?mix(fpc(v3),tpc(txp())):(v8=fpc(v3))!=0?v8:tpc(txp())
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),tpc(txp())):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),tpc(txp())):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),tpc(txp()))):(q=fpc(p))!=0?cto(q):tpo(txp())
  F1T_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XHCT

  //================================================================================
  //F1T_XHCG ($0001,$09xx,$1A23)
  //  概要
  //    F1T  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())):tpc(txp())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(v1,fpc(tod(f2q()))):ls1(v3)!=0?(v9=fpc(tod(f2q())))!=0?v9:tpc(txp()):(v14=fpc(v3))!=0?v14:tpc(txp())
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(txp()):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(txp()):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(txp()):(p=fpc(q))!=0?cto(p):tpo(txp())
  F1T_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XHCG

  //================================================================================
  //F1T_XHCGT ($0001,$09xx,$1B23)
  //  概要
  //    F1T  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()))),tpc(txp())):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(txp())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(txp())):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(mix(v1,fpc(tod(f2q()))),tpc(txp())):ls1(v3)!=0?(v12=fpc(tod(f2q())))!=0?v12:tpc(txp()):(v17=fpc(v3))!=0?v17:tpc(txp())
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),tpc(txp())):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(txp()):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),tpc(txp())):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(txp()):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),tpc(txp()))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(txp()):(p=fpc(q))!=0?cto(p):tpo(txp())
  F1T_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XHCGT

  //================================================================================
  //F1T_XHPT ($0001,$09xx,$1D23)
  //  概要
  //    F1T  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):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):mix(fpc(tev(f1p())),tpc(txp())))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):mix(fpc(tev(f1p())),tpc(txp()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:tpc(txp()):mix(fpc(tev(v0)),tpc(txp()))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(fpc(tev(p)),tpc(txp()))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(fpc(p&-2),tpc(txp()))
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):cto(mix(fpc(p&-2),tpc(txp())))
  F1T_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XHPT

  //================================================================================
  //F1T_XHPG ($0001,$09xx,$1E23)
  //  概要
  //    F1T  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):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):(mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):tpc(txp())))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):tpc(txp())
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:tpc(txp()):(v8=mix(fpc(tev(v0)),fpc(tod(f2q()))))!=0?v8:tpc(txp())
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):(q=mix(fpc(tev(p)),fpc(tod(f2q()))))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?cto(q):tpo(txp())
  F1T_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XHPG

  //================================================================================
  //F1T_XHPGT ($0001,$09xx,$1F23)
  //  概要
  //    F1T  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):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(txp())))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(txp()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=fpc(v0))!=0?v5:tpc(txp()):mix(mix(fpc(tev(v0)),fpc(tod(f2q()))),tpc(txp()))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(mix(fpc(tev(p)),fpc(tod(f2q()))),tpc(txp()))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(mix(fpc(p&-2),fpc(f2q()|1)),tpc(txp()))
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(fpc(p&-2),fpc(f2q()|1)),tpc(txp())))
  F1T_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                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[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                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[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1T_XHPGT

  //================================================================================
  //F2T ($0001,$09xx,$002F)
  //  概要
  //    F2T  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()):tpc(txp())):(fpc(f2p())!=0?fpc(f2p()):tpc(txp())))
  //  中間コード2
  //    f1p()!=0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):fpc(f2p())!=0?fpc(f2p()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?(v1=fpc(v0))!=0?v1:tpc(txp()):(v4=fpc(f2p()))!=0?v4:tpc(txp())
  //  中間コード4
  //    (p=f1p())!=0?(q=fpc(p))!=0?q:tpc(txp()):(p=fpc(f2p()))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=f1p())!=0?(q=fpc(p))!=0?q:tpc(txp()):(p=fpc(f2p()))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=f1p())!=0?(q=fpc(p))!=0?cto(q):tpo(txp()):(p=fpc(f2p()))!=0?cto(p):tpo(txp())
  F2T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T

  //================================================================================
  //XF2T
  //  概要
  //    F2T  512ドット256色2プレーン＞テキスト
  //    拡張あり
  XF2T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F2T_XWC
      case 0b00010001:  //F2T_XWC
      case 0b00010010:  //F2T_XWC
      case 0b00010011:  //F2T_XWC
        F2T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F2T_XWP
      case 0b00010101:  //F2T_XWP
      case 0b00010110:  //F2T_XWP
      case 0b00010111:  //F2T_XWP
        F2T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F2T_XHC
        F2T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F2T_XHCT
        F2T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F2T_XHCG
        F2T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F2T_XHCGT
        F2T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F2T_XHPT
        F2T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F2T_XHPG
        F2T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F2T_XHPGT
        F2T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F2T_A
      case 0b01000001:  //F2T_A
      case 0b01000010:  //F2T_A
      case 0b01000011:  //F2T_A
      case 0b01000100:  //F2T_A
      case 0b01000101:  //F2T_A
      case 0b01000110:  //F2T_A
      case 0b01000111:  //F2T_A
      case 0b01001000:  //F2T_A
      case 0b01001001:  //F2T_A
      case 0b01001010:  //F2T_A
      case 0b01001011:  //F2T_A
      case 0b01001100:  //F2T_A
      case 0b01001101:  //F2T_A
      case 0b01001110:  //F2T_A
      case 0b01001111:  //F2T_A
      case 0b01010000:  //F2T_A
      case 0b01010001:  //F2T_A
      case 0b01010010:  //F2T_A
      case 0b01010011:  //F2T_A
      case 0b01010100:  //F2T_A
      case 0b01010101:  //F2T_A
      case 0b01010110:  //F2T_A
      case 0b01010111:  //F2T_A
      case 0b01011000:  //F2T_A
      case 0b01011001:  //F2T_A
      case 0b01011010:  //F2T_A
      case 0b01011011:  //F2T_A
      case 0b01011100:  //F2T_A
      case 0b01011101:  //F2T_A
      case 0b01011110:  //F2T_A
      case 0b01011111:  //F2T_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        F2T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF2T);
      }  //switch
    }  //drawRaster
  },  //XF2T

  //================================================================================
  //F2T_XWC ($0001,$09xx,$102F)
  //  概要
  //    F2T  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()):tpc(txp()))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(fpc(f2p())!=0?fpc(f2p()):tpc(txp()))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=fpc(v0))!=0?v5:tpc(txp()):ls1(fpc(tev(v11=f2p())))!=0?fpc(v11):(v13=fpc(v11))!=0?v13:tpc(txp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=fpc(p))!=0?q:tpc(txp()):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:tpc(txp()):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp()):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp())
  F2T_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XWC

  //================================================================================
  //F2T_XWP ($0001,$09xx,$142F)
  //  概要
  //    F2T  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())):tpc(txp())):f1p()==1?(fpc(0)!=0?fpc(0):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(txp()):f1p()==1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:tpc(txp()):v0==1?(v6=fpc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=fpc(v0))!=0?v10:tpc(txp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):fpo(p&-2)
  F2T_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XWP

  //================================================================================
  //F2T_XHCT ($0001,$09xx,$192F)
  //  概要
  //    F2T  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()),tpc(txp())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp()))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),tpc(txp())):(fpc(f2p())!=0?fpc(f2p()):tpc(txp()))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(txp())):fpc(f1p())!=0?fpc(f1p()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),tpc(txp())):fpc(f2p())!=0?fpc(f2p()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?mix(fpc(v0),tpc(txp())):(v8=fpc(v0))!=0?v8:tpc(txp()):ls1(fpc(tev(v14=f2p())))!=0?mix(fpc(v14),tpc(txp())):(v19=fpc(v14))!=0?v19:tpc(txp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),tpc(txp())):(q=fpc(p))!=0?q:tpc(txp()):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),tpc(txp())):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),tpc(txp())):(q=fpc(p))!=0?q:tpc(txp()):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),tpc(txp())):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),tpc(txp()))):(q=fpc(p))!=0?cto(q):tpo(txp()):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),tpc(txp()))):(q=fpc(p))!=0?cto(q):tpo(txp())
  F2T_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XHCT

  //================================================================================
  //F2T_XHCG ($0001,$09xx,$1A2F)
  //  概要
  //    F2T  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())):tpc(txp())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp())))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):(fpc(f2p())!=0?fpc(f2p()):tpc(txp()))))
  //  中間コード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())):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())!=0?fpc(f2p()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(v2,fpc(tod(f2q()))):ls1(v0)!=0?(v9=fpc(tod(f2q())))!=0?v9:tpc(txp()):(v14=fpc(v0))!=0?v14:tpc(txp()):ls1(v18=fpc(tev(v20=f2p())))!=0?mix(v18,fpc(tod(f2q()))):(v25=fpc(v20))!=0?v25:tpc(txp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(txp()):(q=fpc(p))!=0?q:tpc(txp()):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(txp()):(q=fpc(p))!=0?q:tpc(txp()):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード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):tpo(txp()):(q=fpc(p))!=0?cto(q):tpo(txp()):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(p=fpc(q))!=0?cto(p):tpo(txp())
  F2T_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15]);
          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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XHCG

  //================================================================================
  //F2T_XHCGT ($0001,$09xx,$1B2F)
  //  概要
  //    F2T  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()))),tpc(txp())):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(txp())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp())))):(ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),tpc(txp())):(fpc(f2p())!=0?fpc(f2p()):tpc(txp()))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(txp())):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?mix(mix(fpc(tev(f2p())),fpc(tod(f2q()))),tpc(txp())):fpc(f2p())!=0?fpc(f2p()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(mix(v2,fpc(tod(f2q()))),tpc(txp())):ls1(v0)!=0?(v12=fpc(tod(f2q())))!=0?v12:tpc(txp()):(v17=fpc(v0))!=0?v17:tpc(txp()):ls1(v21=fpc(tev(v23=f2p())))!=0?mix(mix(v21,fpc(tod(f2q()))),tpc(txp())):(v31=fpc(v23))!=0?v31:tpc(txp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(mix(q,fpc(tod(f2q()))),tpc(txp())):ls1(p)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(txp()):(q=fpc(p))!=0?q:tpc(txp()):ls1(p=fpc(tev(q=f2p())))!=0?mix(mix(p,fpc(tod(f2q()))),tpc(txp())):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(mix(q,fpc(f2q()|1)),tpc(txp())):(p&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(txp()):(q=fpc(p))!=0?q:tpc(txp()):((p=fpc((q=f2p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),tpc(txp())):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(mix(q,fpc(f2q()|1)),tpc(txp()))):(p&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(txp()):(q=fpc(p))!=0?cto(q):tpo(txp()):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),tpc(txp()))):(p=fpc(q))!=0?cto(p):tpo(txp())
  F2T_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XHCGT

  //================================================================================
  //F2T_XHPT ($0001,$09xx,$1D2F)
  //  概要
  //    F2T  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())):tpc(txp())):f1p()==1?(fpc(0)!=0?fpc(0):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):mix(fpc(tev(f1p())),tpc(txp())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(txp()):f1p()==1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):mix(fpc(tev(f1p())),tpc(txp()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:tpc(txp()):v0==1?(v6=fpc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=fpc(v0))!=0?v10:tpc(txp()):mix(fpc(tev(v0)),tpc(txp()))
  //  中間コード4
  //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(fpc(tev(p)),tpc(txp()))
  //  中間コード5
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(fpc(p&-2),tpc(txp()))
  //  中間コード6
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):cto(mix(fpc(p&-2),tpc(txp())))
  F2T_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XHPT

  //================================================================================
  //F2T_XHPG ($0001,$09xx,$1E2F)
  //  概要
  //    F2T  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())):tpc(txp())):f1p()==1?(fpc(0)!=0?fpc(0):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):(mix(fpc(tev(f1p())),fpc(tod(f2p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2p()))):tpc(txp())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(txp()):f1p()==1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):mix(fpc(tev(f1p())),fpc(tod(f2p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2p()))):tpc(txp())
  //  中間コード3
  //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:tpc(txp()):v0==1?(v6=fpc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=fpc(v0))!=0?v10:tpc(txp()):(v13=mix(fpc(tev(v0)),fpc(tod(f2p()))))!=0?v13:tpc(txp())
  //  中間コード4
  //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):(q=mix(fpc(tev(p)),fpc(tod(f2p()))))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):(q=mix(fpc(p&-2),fpc(f2p()|1)))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):(q=mix(fpc(p&-2),fpc(f2p()|1)))!=0?cto(q):tpo(txp())
  F2T_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28]);
          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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15]);
          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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XHPG

  //================================================================================
  //F2T_XHPGT ($0001,$09xx,$1F2F)
  //  概要
  //    F2T  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())):tpc(txp())):f1p()==1?(fpc(0)!=0?fpc(0):tpc(txp())):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(txp())):mix(mix(fpc(tev(f1p())),fpc(tod(f2p()))),tpc(txp())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(txp()):f1p()==1?fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(txp()):mix(mix(fpc(tev(f1p())),fpc(tod(f2p()))),tpc(txp()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:tpc(txp()):v0==1?(v6=fpc(0))!=0?v6:tpc(txp()):ls1(v0)==0?(v10=fpc(v0))!=0?v10:tpc(txp()):mix(mix(fpc(tev(v0)),fpc(tod(f2p()))),tpc(txp()))
  //  中間コード4
  //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(mix(fpc(tev(p)),fpc(tod(f2p()))),tpc(txp()))
  //  中間コード5
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:tpc(txp()):p==1?(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?(q=fpc(p))!=0?q:tpc(txp()):mix(mix(fpc(p&-2),fpc(f2p()|1)),tpc(txp()))
  //  中間コード6
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(fpc(p&-2),fpc(f2p()|1)),tpc(txp())))
  F2T_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp >>> 4 & 15])]);
          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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                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[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp >>> 4 & 15])]);
          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[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                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[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2T_XHPGT

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

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

  //================================================================================
  //GT_XWC ($0003,$09xx,$102F)
  //  概要
  //    GT  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()):tpc(txp())))
  //  中間コード2
  //    ls1(gpc(tod(g1p()),tod(g1p())))!=0?gpc(g1p(),g1p()):gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):tpc(txp())
  //  中間コード3
  //    ls1(gpc(v2=tod(v3=g1p()),v2))!=0?gpc(v3,v3):(v5=gpc(v3,v3))!=0?v5:tpc(txp())
  //  中間コード4
  //    ls1(gpc(p=tod(q=g1p()),p))!=0?gpc(q,q):(p=gpc(q,q))!=0?p:tpc(txp())
  //  中間コード5
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?gpc(q,q):(p=gpc(q,q))!=0?p:tpc(txp())
  //  中間コード6
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?gpo(q,q):(p=gpc(q,q))!=0?cto(p):tpo(txp())
  GT_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //1番目のパレットのbit11-8のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //1番目のパレットのbit15-12のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((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[tp >>> 28]);
          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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15]);
          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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((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[tp >>> 28]);
          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[tp >>> 24 & 15]);
          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[tp >>> 20 & 15]);
          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[tp >>> 16 & 15]);
          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[tp >>> 12 & 15]);
          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[tp >>> 8 & 15]);
          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[tp >>> 4 & 15]);
          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[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //GT_XWC

  //================================================================================
  //GT_XWP ($0003,$09xx,$142F)
  //  概要
  //    GT  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):tpc(txp())):ls1(g1p())==0?(gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):tpc(txp())):gpc(tev(g1p()),tev(g1p())))
  //  中間コード2
  //    g1p()<=1?gpc(0,0)!=0?gpc(0,0):tpc(txp()):ls1(g1p())==0?gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):tpc(txp()):gpc(tev(g1p()),tev(g1p()))
  //  中間コード3
  //    (v0=g1p())<=1?(v1=gpc(0,0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=gpc(v0,v0))!=0?v5:tpc(txp()):gpc(v9=tev(v0),v9)
  //  中間コード4
  //    (p=g1p())<=1?(p=gpc(0,0))!=0?p:tpc(txp()):ls1(p)==0?(q=gpc(p,p))!=0?q:tpc(txp()):gpc(q=tev(p),q)
  //  中間コード5
  //    (p=g1p())<=1?(p=gpc(0,0))!=0?p:tpc(txp()):(p&1)==0?(q=gpc(p,p))!=0?q:tpc(txp()):gpc(q=p&-2,q)
  //  中間コード6
  //    (p=g1p())<=1?(p=gpc(0,0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=gpc(p,p))!=0?cto(q):tpo(txp()):gpo(q=p&-2,q)
  GT_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //1番目のパレットのbit11-8のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //1番目のパレットのbit15-12のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = (VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = (VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //GT_XWP

  //================================================================================
  //GT_XHCT ($0003,$09xx,$192F)
  //  概要
  //    GT  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()),tpc(txp())):(gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):tpc(txp())))
  //  中間コード2
  //    ls1(gpc(tod(g1p()),tod(g1p())))!=0?mix(gpc(g1p(),g1p()),tpc(txp())):gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):tpc(txp())
  //  中間コード3
  //    ls1(gpc(v2=tod(v3=g1p()),v2))!=0?mix(gpc(v3,v3),tpc(txp())):(v8=gpc(v3,v3))!=0?v8:tpc(txp())
  //  中間コード4
  //    ls1(gpc(p=tod(q=g1p()),p))!=0?mix(gpc(q,q),tpc(txp())):(p=gpc(q,q))!=0?p:tpc(txp())
  //  中間コード5
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?mix(gpc(q,q),tpc(txp())):(p=gpc(q,q))!=0?p:tpc(txp())
  //  中間コード6
  //    (gpc(p=(q=g1p())|1,p)&1)!=0?cto(mix(gpc(q,q),tpc(txp()))):(p=gpc(q,q))!=0?cto(p):tpo(txp())
  GT_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //1番目のパレットのbit11-8のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //1番目のパレットのbit15-12のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((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[tp >>> 28])] :
                            (p = (VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255])) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((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[tp >>> 28])] :
                            (p = (VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255])) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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[tp >>> 24 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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[tp >>> 20 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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[tp >>> 16 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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[tp >>> 12 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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[tp >>> 8 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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[tp >>> 4 & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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[tp & 15])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //GT_XHCT

  //================================================================================
  //GT_XHPT ($0003,$09xx,$1D2F)
  //  概要
  //    GT  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):tpc(txp())):ls1(g1p())==0?(gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):tpc(txp())):mix(gpc(tev(g1p()),tev(g1p())),tpc(txp())))
  //  中間コード2
  //    g1p()<=1?gpc(0,0)!=0?gpc(0,0):tpc(txp()):ls1(g1p())==0?gpc(g1p(),g1p())!=0?gpc(g1p(),g1p()):tpc(txp()):mix(gpc(tev(g1p()),tev(g1p())),tpc(txp()))
  //  中間コード3
  //    (v0=g1p())<=1?(v1=gpc(0,0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=gpc(v0,v0))!=0?v5:tpc(txp()):mix(gpc(v10=tev(v0),v10),tpc(txp()))
  //  中間コード4
  //    (p=g1p())<=1?(p=gpc(0,0))!=0?p:tpc(txp()):ls1(p)==0?(q=gpc(p,p))!=0?q:tpc(txp()):mix(gpc(q=tev(p),q),tpc(txp()))
  //  中間コード5
  //    (p=g1p())<=1?(p=gpc(0,0))!=0?p:tpc(txp()):(p&1)==0?(q=gpc(p,p))!=0?q:tpc(txp()):mix(gpc(q=p&-2,q),tpc(txp()))
  //  中間コード6
  //    (p=g1p())<=1?(p=gpc(0,0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=gpc(p,p))!=0?cto(q):tpo(txp()):cto(mix(gpc(q=p&-2,q),tpc(txp())))
  GT_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //1番目のパレットのbit11-8のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //1番目のパレットのbit15-12のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = (pn << 18) + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = (VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                 VideoController.vcnPal8G16L[q & 255]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = (VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                 VideoController.vcnPal8G16L[q & 255]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          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[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          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[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          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[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          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[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          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[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          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[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          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[tp & 15] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //GT_XHPT

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

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

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

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

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

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

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

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

  //================================================================================
  //IT_XWC ($0005,$09xx,$1030)
  //  概要
  //    IT  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()):tpc(txp())))
  //  中間コード2
  //    ls1(ipc(tev(i1p())))!=0?ipc(i1p()):ipc(i1p())!=0?ipc(i1p()):tpc(txp())
  //  中間コード3
  //    ls1(ipc(tev(v3=i1p())))!=0?ipc(v3):(v5=ipc(v3))!=0?v5:tpc(txp())
  //  中間コード4
  //    ls1(ipc(tev(p=i1p())))!=0?ipc(p):(q=ipc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (ipc((p=i1p())&-2)&1)!=0?ipc(p):(q=ipc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (ipc((p=i1p())&-2)&1)!=0?ipo(p):(q=ipc(p))!=0?cto(q):tpo(txp())
  IT_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((VideoController.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[tp >>> 28]);
            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[tp >>> 24 & 15]);
            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[tp >>> 20 & 15]);
            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[tp >>> 16 & 15]);
            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[tp >>> 12 & 15]);
            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[tp >>> 8 & 15]);
            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[tp >>> 4 & 15]);
            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[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.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[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((VideoController.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[tp >>> 28]);
            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[tp >>> 24 & 15]);
            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[tp >>> 20 & 15]);
            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[tp >>> 16 & 15]);
            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[tp >>> 12 & 15]);
            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[tp >>> 8 & 15]);
            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[tp >>> 4 & 15]);
            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[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.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[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //IT_XWC

  //================================================================================
  //IT_XWP ($0005,$09xx,$1430)
  //  概要
  //    IT  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):tpc(txp())):ls1(i1p())==0?(ipc(i1p())!=0?ipc(i1p()):tpc(txp())):ipc(tev(i1p())))
  //  中間コード2
  //    i1p()<=1?ipc(0)!=0?ipc(0):tpc(txp()):ls1(i1p())==0?ipc(i1p())!=0?ipc(i1p()):tpc(txp()):ipc(tev(i1p()))
  //  中間コード3
  //    (v0=i1p())<=1?(v1=ipc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=ipc(v0))!=0?v5:tpc(txp()):ipc(tev(v0))
  //  中間コード4
  //    (p=i1p())<=1?(p=ipc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=ipc(p))!=0?q:tpc(txp()):ipc(tev(p))
  //  中間コード5
  //    (p=i1p())<=1?(p=ipc(0))!=0?p:tpc(txp()):(p&1)==0?(q=ipc(p))!=0?q:tpc(txp()):ipc(p&-2)
  //  中間コード6
  //    (p=i1p())<=1?(p=ipc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=ipc(p))!=0?cto(q):tpo(txp()):ipo(p&-2)
  IT_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPal32G8[p & -2]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPal32G8[p & -2]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPal32G8[p & -2]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPal32G8[p & -2]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //IT_XWP

  //================================================================================
  //IT_XHCT ($0005,$09xx,$1930)
  //  概要
  //    IT  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()),tpc(txp())):(ipc(i1p())!=0?ipc(i1p()):tpc(txp())))
  //  中間コード2
  //    ls1(ipc(tev(i1p())))!=0?mix(ipc(i1p()),tpc(txp())):ipc(i1p())!=0?ipc(i1p()):tpc(txp())
  //  中間コード3
  //    ls1(ipc(tev(v3=i1p())))!=0?mix(ipc(v3),tpc(txp())):(v8=ipc(v3))!=0?v8:tpc(txp())
  //  中間コード4
  //    ls1(ipc(tev(p=i1p())))!=0?mix(ipc(p),tpc(txp())):(q=ipc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (ipc((p=i1p())&-2)&1)!=0?mix(ipc(p),tpc(txp())):(q=ipc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (ipc((p=i1p())&-2)&1)!=0?cto(mix(ipc(p),tpc(txp()))):(q=ipc(p))!=0?cto(q):tpo(txp())
  IT_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[tp >>> 28])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28]);
            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[tp >>> 24 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15]);
            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[tp >>> 20 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15]);
            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[tp >>> 16 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15]);
            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[tp >>> 12 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15]);
            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[tp >>> 8 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15]);
            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[tp >>> 4 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15]);
            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[tp & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                  GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p],
                                  VideoController.vcnPal16TS[tp >>> 28])] :
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28]);
            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[tp >>> 24 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15]);
            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[tp >>> 20 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15]);
            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[tp >>> 16 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15]);
            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[tp >>> 12 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15]);
            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[tp >>> 8 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15]);
            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[tp >>> 4 & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15]);
            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[tp & 15])] :
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                  GraphicScreen.graM4[ga])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //IT_XHCT

  //================================================================================
  //IT_XHPT ($0005,$09xx,$1D30)
  //  概要
  //    IT  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):tpc(txp())):ls1(i1p())==0?(ipc(i1p())!=0?ipc(i1p()):tpc(txp())):mix(ipc(tev(i1p())),tpc(txp())))
  //  中間コード2
  //    i1p()<=1?ipc(0)!=0?ipc(0):tpc(txp()):ls1(i1p())==0?ipc(i1p())!=0?ipc(i1p()):tpc(txp()):mix(ipc(tev(i1p())),tpc(txp()))
  //  中間コード3
  //    (v0=i1p())<=1?(v1=ipc(0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=ipc(v0))!=0?v5:tpc(txp()):mix(ipc(tev(v0)),tpc(txp()))
  //  中間コード4
  //    (p=i1p())<=1?(p=ipc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=ipc(p))!=0?q:tpc(txp()):mix(ipc(tev(p)),tpc(txp()))
  //  中間コード5
  //    (p=i1p())<=1?(p=ipc(0))!=0?p:tpc(txp()):(p&1)==0?(q=ipc(p))!=0?q:tpc(txp()):mix(ipc(p&-2),tpc(txp()))
  //  中間コード6
  //    (p=i1p())<=1?(p=ipc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=ipc(p))!=0?cto(q):tpo(txp()):cto(mix(ipc(p&-2),tpc(txp())))
  IT_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16TS[tp >>> 28])]);
            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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 24 & 15])]);
            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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 20 & 15])]);
            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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 16 & 15])]);
            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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 12 & 15])]);
            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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 8 & 15])]);
            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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 4 & 15])]);
            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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp & 15])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = VideoController.vcnPal16G8[0]) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = VideoController.vcnPal16G8[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16TS[tp >>> 28])]);
            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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 24 & 15])]);
            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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 20 & 15])]);
            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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 16 & 15])]);
            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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 12 & 15])]);
            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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 8 & 15])]);
            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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp >>> 4 & 15])]);
            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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = VideoController.vcnPal16G8[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16TS[tp & 15])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //IT_XHPT

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

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

  //================================================================================
  //JT_XWC ($0007,$09xx,$1030)
  //  概要
  //    JT  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()):tpc(txp())))
  //  中間コード2
  //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?jpc(j1p(),j1p()):jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(txp())
  //  中間コード3
  //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?jpc(v3,v3):(v5=jpc(v3,v3))!=0?v5:tpc(txp())
  //  中間コード4
  //    ls1(jpc(p=tod(q=j1p()),p))!=0?jpc(q,q):(p=jpc(q,q))!=0?p:tpc(txp())
  //  中間コード5
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpc(q,q):(p=jpc(q,q))!=0?p:tpc(txp())
  //  中間コード6
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?jpo(q,q):(p=jpc(q,q))!=0?cto(p):tpo(txp())
  JT_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                       GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                       GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                       GraphicScreen.graM4[ga])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]] :
                              (p = (VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28]);
            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[tp >>> 24 & 15]);
            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[tp >>> 20 & 15]);
            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[tp >>> 16 & 15]);
            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[tp >>> 12 & 15]);
            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[tp >>> 8 & 15]);
            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[tp >>> 4 & 15]);
            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[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                       GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                       GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                       GraphicScreen.graM4[ga])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[q >> 8] |
                                VideoController.vcnPal8G16L[q & 255]] :
                              (p = (VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28]);
            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[tp >>> 24 & 15]);
            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[tp >>> 20 & 15]);
            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[tp >>> 16 & 15]);
            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[tp >>> 12 & 15]);
            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[tp >>> 8 & 15]);
            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[tp >>> 4 & 15]);
            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[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[q >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //JT_XWC

  //================================================================================
  //JT_XWP ($0007,$09xx,$1430)
  //  概要
  //    JT  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):tpc(txp())):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(txp())):jpc(tev(j1p()),tev(j1p())))
  //  中間コード2
  //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):tpc(txp()):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(txp()):jpc(tev(j1p()),tev(j1p()))
  //  中間コード3
  //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=jpc(v0,v0))!=0?v5:tpc(txp()):jpc(v9=tev(v0),v9)
  //  中間コード4
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(txp()):ls1(p)==0?(q=jpc(p,p))!=0?q:tpc(txp()):jpc(q=tev(p),q)
  //  中間コード5
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(txp()):(p&1)==0?(q=jpc(p,p))!=0?q:tpc(txp()):jpc(q=p&-2,q)
  //  中間コード6
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=jpc(p,p))!=0?cto(q):tpo(txp()):jpo(q=p&-2,q)
  JT_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //JT_XWP

  //================================================================================
  //JT_XHCT ($0007,$09xx,$1930)
  //  概要
  //    JT  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()),tpc(txp())):(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(txp())))
  //  中間コード2
  //    ls1(jpc(tod(j1p()),tod(j1p())))!=0?mix(jpc(j1p(),j1p()),tpc(txp())):jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(txp())
  //  中間コード3
  //    ls1(jpc(v2=tod(v3=j1p()),v2))!=0?mix(jpc(v3,v3),tpc(txp())):(v8=jpc(v3,v3))!=0?v8:tpc(txp())
  //  中間コード4
  //    ls1(jpc(p=tod(q=j1p()),p))!=0?mix(jpc(q,q),tpc(txp())):(p=jpc(q,q))!=0?p:tpc(txp())
  //  中間コード5
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?mix(jpc(q,q),tpc(txp())):(p=jpc(q,q))!=0?p:tpc(txp())
  //  中間コード6
  //    (jpc(p=(q=j1p())|1,p)&1)!=0?cto(mix(jpc(q,q),tpc(txp()))):(p=jpc(q,q))!=0?cto(p):tpo(txp())
  JT_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                       GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                       GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                       GraphicScreen.graM4[ga])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[tp >>> 28])] :
                              (p = (VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28]);
            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[tp >>> 24 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15]);
            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[tp >>> 20 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15]);
            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[tp >>> 16 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15]);
            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[tp >>> 12 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15]);
            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[tp >>> 8 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15]);
            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[tp >>> 4 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15]);
            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[tp & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                       GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                       GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                       GraphicScreen.graM4[ga])) | 1) >> 8] |
                                VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[q >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[tp >>> 28])] :
                              (p = (VideoController.vcnPal8G16H[q >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28]);
            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[tp >>> 24 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15]);
            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[tp >>> 20 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15]);
            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[tp >>> 16 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15]);
            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[tp >>> 12 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15]);
            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[tp >>> 8 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15]);
            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[tp >>> 4 & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15]);
            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[tp & 15])] :
                                  (p = (VideoController.vcnPal8G16H[q >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[tp & 15]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = (((VideoController.vcnPal8G16H[(p = (q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                         GraphicScreen.graM4[ga])) | 1) >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[q >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 28])] :
                                (p = (VideoController.vcnPal8G16H[q >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //JT_XHCT

  //================================================================================
  //JT_XHPT ($0007,$09xx,$1D30)
  //  概要
  //    JT  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):tpc(txp())):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(txp())):mix(jpc(tev(j1p()),tev(j1p())),tpc(txp())))
  //  中間コード2
  //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):tpc(txp()):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(txp()):mix(jpc(tev(j1p()),tev(j1p())),tpc(txp()))
  //  中間コード3
  //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:tpc(txp()):ls1(v0)==0?(v5=jpc(v0,v0))!=0?v5:tpc(txp()):mix(jpc(v10=tev(v0),v10),tpc(txp()))
  //  中間コード4
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(txp()):ls1(p)==0?(q=jpc(p,p))!=0?q:tpc(txp()):mix(jpc(q=tev(p),q),tpc(txp()))
  //  中間コード5
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(txp()):(p&1)==0?(q=jpc(p,p))!=0?q:tpc(txp()):mix(jpc(q=p&-2,q),tpc(txp()))
  //  中間コード6
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=jpc(p,p))!=0?cto(q):tpo(txp()):cto(mix(jpc(q=p&-2,q),tpc(txp())))
  JT_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[tp >>> 28])]);
            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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 24 & 15])]);
            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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 20 & 15])]);
            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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 16 & 15])]);
            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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 12 & 15])]);
            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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 8 & 15])]);
            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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 4 & 15])]);
            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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp & 15])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[tp >>> 28] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[tp >>> 28])]);
            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[tp >>> 24 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 24 & 15])]);
            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[tp >>> 20 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 20 & 15])]);
            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[tp >>> 16 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 16 & 15])]);
            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[tp >>> 12 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 12 & 15])]);
            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[tp >>> 8 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 8 & 15])]);
            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[tp >>> 4 & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp >>> 4 & 15])]);
            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[tp & 15] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[tp & 15] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[tp & 15])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 28] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[tp >>> 28])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //JT_XHPT

  //================================================================================
  //E1t ($0000,$09xx,$0001)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    1番目のカラーが0でないとき
  //      1番目のカラー
  //    さもなくば(1番目のカラーが0のとき)
  //      テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (epc(e1p())!=0?epc(e1p()):tpc(0))
  //  中間コード2
  //    epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    (v0=epc(e1p()))!=0?v0:tpc(0)
  //  中間コード4
  //    (p=epc(e1p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=epc(e1p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=epc(e1p()))!=0?cto(p):tpo(0)
  E1t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t

  //================================================================================
  //XE1t
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    拡張あり
  XE1t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E1t_XWC
      case 0b00010001:  //E1t_XWC
      case 0b00010010:  //E1t_XWC
      case 0b00010011:  //E1t_XWC
        E1t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E1t_XWP
      case 0b00010101:  //E1t_XWP
      case 0b00010110:  //E1t_XWP
      case 0b00010111:  //E1t_XWP
        E1t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E1t_XHC
        E1t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E1t_XHCT
        E1t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E1t_XHCG
        E1t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E1t_XHCGT
        E1t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E1t_XHPT
        E1t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E1t_XHPG
        E1t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E1t_XHPGT
        E1t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E1t_A
      case 0b01000001:  //E1t_A
      case 0b01000010:  //E1t_A
      case 0b01000011:  //E1t_A
      case 0b01000100:  //E1t_A
      case 0b01000101:  //E1t_A
      case 0b01000110:  //E1t_A
      case 0b01000111:  //E1t_A
      case 0b01001000:  //E1t_A
      case 0b01001001:  //E1t_A
      case 0b01001010:  //E1t_A
      case 0b01001011:  //E1t_A
      case 0b01001100:  //E1t_A
      case 0b01001101:  //E1t_A
      case 0b01001110:  //E1t_A
      case 0b01001111:  //E1t_A
      case 0b01010000:  //E1t_A
      case 0b01010001:  //E1t_A
      case 0b01010010:  //E1t_A
      case 0b01010011:  //E1t_A
      case 0b01010100:  //E1t_A
      case 0b01010101:  //E1t_A
      case 0b01010110:  //E1t_A
      case 0b01010111:  //E1t_A
      case 0b01011000:  //E1t_A
      case 0b01011001:  //E1t_A
      case 0b01011010:  //E1t_A
      case 0b01011011:  //E1t_A
      case 0b01011100:  //E1t_A
      case 0b01011101:  //E1t_A
      case 0b01011110:  //E1t_A
      case 0b01011111:  //E1t_A
        E1t_A.drawRaster (src, dst, rh);
        break;
      default:
        E1t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE1t);
      }  //switch
    }  //drawRaster
  },  //XE1t

  //================================================================================
  //E1t_XWP ($0000,$09xx,$1401)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):epc(tev(e1p())))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=epc(v0))!=0?v4:tpc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):epo(p&-2)
  E1t_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_XWP

  //================================================================================
  //E1t_XHCT ($0000,$09xx,$1901)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    ls1(epc(tev(v3=e1p())))!=0?mix(epc(v3),tpc(0)):(v7=epc(v3))!=0?v7:tpc(0)
  //  中間コード4
  //    ls1(epc(tev(p=e1p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (epc((p=e1p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  E1t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_XHCT

  //================================================================================
  //E1t_XHCG ($0000,$09xx,$1A01)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(v1,epc(tod(e2q()))):ls1(v3)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(0):(v13=epc(v3))!=0?v13:tpc(0)
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  E1t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_XHCG

  //================================================================================
  //E1t_XHCGT ($0000,$09xx,$1B01)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(mix(v1,epc(tod(e2q()))),tpc(0)):ls1(v3)!=0?(v11=epc(tod(e2q())))!=0?v11:tpc(0):(v15=epc(v3))!=0?v15:tpc(0)
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),tpc(0)):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),tpc(0)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),tpc(0))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  E1t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_XHCGT

  //================================================================================
  //E1t_XHPT ($0000,$09xx,$1D01)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(epc(tev(e1p())),tpc(0)))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),tpc(0))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=epc(v0))!=0?v4:tpc(0):mix(epc(tev(v0)),tpc(0))
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(tev(p)),tpc(0))
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(p&-2),tpc(0))
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(epc(p&-2),tpc(0)))
  E1t_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_XHPT

  //================================================================================
  //E1t_XHPG ($0000,$09xx,$1E01)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=epc(v0))!=0?v4:tpc(0):(v6=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v6:tpc(0)
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(0)
  E1t_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_XHPG

  //================================================================================
  //E1t_XHPGT ($0000,$09xx,$1F01)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)))
  //  中間コード2
  //    e1p()<=1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=epc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=epc(v0))!=0?v4:tpc(0):mix(mix(epc(tev(v0)),epc(tod(e2q()))),tpc(0))
  //  中間コード4
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(0))
  //  中間コード5
  //    (p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0))
  //  中間コード6
  //    (p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0)))
  E1t_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_XHPGT

  //================================================================================
  //E1t_A ($0000,$09xx,$4001)
  //  概要
  //    E1t  512ドット16色1プレーン＞テキスト(OFF)
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(epc(e1p()),tpc(0))
  //  中間コード2
  //    mix(epc(e1p()),tpc(0))
  //  中間コード3
  //    mix(epc(e1p()),tpc(0))
  //  中間コード4
  //    mix(epc(e1p()),tpc(0))
  //  中間コード5
  //    mix(epc(e1p()),tpc(0))
  //  中間コード6
  //    cto(mix(epc(e1p()),tpc(0)))
  E1t_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1t_A

  //================================================================================
  //E2t ($0000,$09xx,$0003)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーが0でないとき
  //        2番目のカラー
  //      さもなくば(2番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0)))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(0):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:tpc(0):(v3=epc(e2p()))!=0?v3:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e2p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e2p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e2p()))!=0?cto(p):tpo(0)
  E2t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t

  //================================================================================
  //XE2t
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    拡張あり
  XE2t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E2t_XWC
      case 0b00010001:  //E2t_XWC
      case 0b00010010:  //E2t_XWC
      case 0b00010011:  //E2t_XWC
        E2t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E2t_XWP
      case 0b00010101:  //E2t_XWP
      case 0b00010110:  //E2t_XWP
      case 0b00010111:  //E2t_XWP
        E2t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E2t_XHC
        E2t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E2t_XHCT
        E2t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E2t_XHCG
        E2t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E2t_XHCGT
        E2t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E2t_XHPT
        E2t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E2t_XHPG
        E2t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E2t_XHPGT
        E2t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E2t_A
      case 0b01000001:  //E2t_A
      case 0b01000010:  //E2t_A
      case 0b01000011:  //E2t_A
      case 0b01000100:  //E2t_A
      case 0b01000101:  //E2t_A
      case 0b01000110:  //E2t_A
      case 0b01000111:  //E2t_A
      case 0b01001000:  //E2t_A
      case 0b01001001:  //E2t_A
      case 0b01001010:  //E2t_A
      case 0b01001011:  //E2t_A
      case 0b01001100:  //E2t_A
      case 0b01001101:  //E2t_A
      case 0b01001110:  //E2t_A
      case 0b01001111:  //E2t_A
      case 0b01010000:  //E2t_A
      case 0b01010001:  //E2t_A
      case 0b01010010:  //E2t_A
      case 0b01010011:  //E2t_A
      case 0b01010100:  //E2t_A
      case 0b01010101:  //E2t_A
      case 0b01010110:  //E2t_A
      case 0b01010111:  //E2t_A
      case 0b01011000:  //E2t_A
      case 0b01011001:  //E2t_A
      case 0b01011010:  //E2t_A
      case 0b01011011:  //E2t_A
      case 0b01011100:  //E2t_A
      case 0b01011101:  //E2t_A
      case 0b01011110:  //E2t_A
      case 0b01011111:  //E2t_A
        E2t_A.drawRaster (src, dst, rh);
        break;
      default:
        E2t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE2t);
      }  //switch
    }  //drawRaster
  },  //XE2t

  //================================================================================
  //E2t_XWP ($0000,$09xx,$1403)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(0):v0==1?(v5=epc(0))!=0?v5:tpc(0):ls1(v0)==0?(v8=epc(v0))!=0?v8:tpc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):epo(p&-2)
  E2t_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_XWP

  //================================================================================
  //E2t_XHCT ($0000,$09xx,$1903)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),tpc(0)):(v7=epc(v0))!=0?v7:tpc(0):ls1(epc(tev(v12=e2p())))!=0?mix(epc(v12),tpc(0)):(v16=epc(v12))!=0?v16:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  E2t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_XHCT

  //================================================================================
  //E2t_XHCG ($0000,$09xx,$1A03)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレット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())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(0))))
  //  中間コード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())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(0):(v13=epc(v0))!=0?v13:tpc(0):ls1(v16=epc(tev(v18=e2p())))!=0?mix(v16,epc(tod(e2q()))):(v23=epc(v18))!=0?v23:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(p=epc(q))!=0?p:tpc(0)
  //  中間コード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):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(p=epc(q))!=0?cto(p):tpo(0)
  E2t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_XHCG

  //================================================================================
  //E2t_XHCGT ($0000,$09xx,$1B03)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),tpc(0)):ls1(v0)!=0?(v11=epc(tod(e2q())))!=0?v11:tpc(0):(v15=epc(v0))!=0?v15:tpc(0):ls1(v18=epc(tev(v20=e2p())))!=0?mix(mix(v18,epc(tod(e2q()))),tpc(0)):(v27=epc(v20))!=0?v27:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),tpc(0)):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),tpc(0)):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),tpc(0))):(p=epc(q))!=0?cto(p):tpo(0)
  E2t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_XHCGT

  //================================================================================
  //E2t_XHPT ($0000,$09xx,$1D03)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(epc(tev(e1p())),tpc(0)))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),tpc(0))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(0):v0==1?(v5=epc(0))!=0?v5:tpc(0):ls1(v0)==0?(v8=epc(v0))!=0?v8:tpc(0):mix(epc(tev(v0)),tpc(0))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(tev(p)),tpc(0))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(p&-2),tpc(0))
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(epc(p&-2),tpc(0)))
  E2t_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_XHPT

  //================================================================================
  //E2t_XHPG ($0000,$09xx,$1E03)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):tpc(0)))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):tpc(0)
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(0):v0==1?(v5=epc(0))!=0?v5:tpc(0):ls1(v0)==0?(v8=epc(v0))!=0?v8:tpc(0):(v10=mix(epc(tev(v0)),epc(tod(e2p()))))!=0?v10:tpc(0)
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(tev(p)),epc(tod(e2p()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?cto(q):tpo(0)
  E2t_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_XHPG

  //================================================================================
  //E2t_XHPGT ($0000,$09xx,$1F03)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),tpc(0)))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),tpc(0))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:tpc(0):v0==1?(v5=epc(0))!=0?v5:tpc(0):ls1(v0)==0?(v8=epc(v0))!=0?v8:tpc(0):mix(mix(epc(tev(v0)),epc(tod(e2p()))),tpc(0))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(tev(p)),epc(tod(e2p()))),tpc(0))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(p&-2),epc(e2p()|1)),tpc(0))
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(mix(epc(p&-2),epc(e2p()|1)),tpc(0)))
  E2t_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_XHPGT

  //================================================================================
  //E2t_A ($0000,$09xx,$4003)
  //  概要
  //    E2t  512ドット16色2プレーン＞テキスト(OFF)
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?mix(epc(e1p()),tpc(0)):mix(epc(e2p()),tpc(0)))
  //  中間コード2
  //    e1p()!=0?mix(epc(e1p()),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード3
  //    (v0=e1p())!=0?mix(epc(v0),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード4
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード5
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):mix(epc(e2p()),tpc(0))
  //  中間コード6
  //    cto((p=e1p())!=0?mix(epc(p),tpc(0)):mix(epc(e2p()),tpc(0)))
  E2t_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2t_A

  //================================================================================
  //E3t ($0000,$09xx,$0007)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のカラーが0でないとき
  //          3番目のカラー
  //        さもなくば(3番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?epc(e2p())!=0?epc(e2p()):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:tpc(0):(v3=e2p())!=0?(v4=epc(v3))!=0?v4:tpc(0):(v6=epc(e3p()))!=0?v6:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e3p()))!=0?cto(p):tpo(0)
  E3t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t

  //================================================================================
  //XE3t
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    拡張あり
  XE3t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E3t_XWC
      case 0b00010001:  //E3t_XWC
      case 0b00010010:  //E3t_XWC
      case 0b00010011:  //E3t_XWC
        E3t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E3t_XWP
      case 0b00010101:  //E3t_XWP
      case 0b00010110:  //E3t_XWP
      case 0b00010111:  //E3t_XWP
        E3t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E3t_XHC
        E3t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E3t_XHCT
        E3t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E3t_XHCG
        E3t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E3t_XHCGT
        E3t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E3t_XHPT
        E3t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E3t_XHPG
        E3t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E3t_XHPGT
        E3t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E3t_A
      case 0b01000001:  //E3t_A
      case 0b01000010:  //E3t_A
      case 0b01000011:  //E3t_A
      case 0b01000100:  //E3t_A
      case 0b01000101:  //E3t_A
      case 0b01000110:  //E3t_A
      case 0b01000111:  //E3t_A
      case 0b01001000:  //E3t_A
      case 0b01001001:  //E3t_A
      case 0b01001010:  //E3t_A
      case 0b01001011:  //E3t_A
      case 0b01001100:  //E3t_A
      case 0b01001101:  //E3t_A
      case 0b01001110:  //E3t_A
      case 0b01001111:  //E3t_A
      case 0b01010000:  //E3t_A
      case 0b01010001:  //E3t_A
      case 0b01010010:  //E3t_A
      case 0b01010011:  //E3t_A
      case 0b01010100:  //E3t_A
      case 0b01010101:  //E3t_A
      case 0b01010110:  //E3t_A
      case 0b01010111:  //E3t_A
      case 0b01011000:  //E3t_A
      case 0b01011001:  //E3t_A
      case 0b01011010:  //E3t_A
      case 0b01011011:  //E3t_A
      case 0b01011100:  //E3t_A
      case 0b01011101:  //E3t_A
      case 0b01011110:  //E3t_A
      case 0b01011111:  //E3t_A
        E3t_A.drawRaster (src, dst, rh);
        break;
      default:
        E3t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE3t);
      }  //switch
    }  //drawRaster
  },  //XE3t

  //================================================================================
  //E3t_XWP ($0000,$09xx,$1407)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=epc(tev(e3p())))!=0?v5:tpc(0):v0==1?(v9=epc(0))!=0?v9:tpc(0):ls1(v0)==0?(v12=epc(v0))!=0?v12:tpc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e3p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e3p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):epo(p&-2)
  E3t_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_XWP

  //================================================================================
  //E3t_XHCT ($0000,$09xx,$1907)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),tpc(0)):(v7=epc(v0))!=0?v7:tpc(0):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),tpc(0)):(v16=epc(v9))!=0?v16:tpc(0):ls1(epc(tev(v21=e3p())))!=0?mix(epc(v21),tpc(0)):(v25=epc(v21))!=0?v25:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  E3t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_XHCT

  //================================================================================
  //E3t_XHCG ($0000,$09xx,$1A07)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレット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())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(0))):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0))))))
  //  中間コード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())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(0):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(0):(v13=epc(v0))!=0?v13:tpc(0):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):(v23=epc(v15))!=0?v23:tpc(0):ls1(v26=epc(tev(v28=e3p())))!=0?mix(v26,epc(1)):ls1(v28)!=0?(v32=epc(1))!=0?v32:tpc(0):(v34=epc(v28))!=0?v34:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード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):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  E3t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_XHCG

  //================================================================================
  //E3t_XHCGT ($0000,$09xx,$1B07)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),tpc(0)):ls1(v0)!=0?(v11=epc(tod(e2q())))!=0?v11:tpc(0):(v15=epc(v0))!=0?v15:tpc(0):(v17=e2p())!=0?ls1(v19=epc(tev(v17)))!=0?mix(mix(v19,epc(tod(e2q()))),tpc(0)):(v27=epc(v17))!=0?v27:tpc(0):ls1(v30=epc(tev(v32=e3p())))!=0?mix(mix(v30,epc(1)),tpc(0)):ls1(v32)!=0?(v38=epc(1))!=0?v38:tpc(0):(v40=epc(v32))!=0?v40:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),tpc(0)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),tpc(0)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),tpc(0))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  E3t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_XHCGT

  //================================================================================
  //E3t_XHPT ($0000,$09xx,$1D07)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(epc(tev(e1p())),tpc(0)))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),tpc(0))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=epc(tev(e3p())))!=0?v5:tpc(0):v0==1?(v9=epc(0))!=0?v9:tpc(0):ls1(v0)==0?(v12=epc(v0))!=0?v12:tpc(0):mix(epc(tev(v0)),tpc(0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e3p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(tev(p)),tpc(0))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(p&-2),tpc(0))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e3p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(epc(p&-2),tpc(0)))
  E3t_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_XHPT

  //================================================================================
  //E3t_XHPG ($0000,$09xx,$1E07)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=epc(tev(e3p())))!=0?v5:tpc(0):v0==1?(v9=epc(0))!=0?v9:tpc(0):ls1(v0)==0?(v12=epc(v0))!=0?v12:tpc(0):(v14=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v14:tpc(0)
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e3p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e3p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(0)
  E3t_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_XHPG

  //================================================================================
  //E3t_XHPGT ($0000,$09xx,$1F07)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが0でないとき
  //          3番目のパレットを偶数化したパレットのカラー
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=epc(tev(e3p())))!=0?v5:tpc(0):v0==1?(v9=epc(0))!=0?v9:tpc(0):ls1(v0)==0?(v12=epc(v0))!=0?v12:tpc(0):mix(mix(epc(tev(v0)),epc(tod(e2q()))),tpc(0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e3p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(0))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e3p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0)))
  E3t_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_XHPGT

  //================================================================================
  //E3t_A ($0000,$09xx,$4007)
  //  概要
  //    E3t  512ドット16色3プレーン＞テキスト(OFF)
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?mix(epc(e1p()),tpc(0)):(e2p()!=0?mix(epc(e2p()),tpc(0)):mix(epc(e3p()),tpc(0))))
  //  中間コード2
  //    e1p()!=0?mix(epc(e1p()),tpc(0)):e2p()!=0?mix(epc(e2p()),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード3
  //    (v0=e1p())!=0?mix(epc(v0),tpc(0)):(v4=e2p())!=0?mix(epc(v4),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード4
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード5
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):mix(epc(e3p()),tpc(0))
  //  中間コード6
  //    cto((p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):mix(epc(e3p()),tpc(0)))
  E3t_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3t_A

  //================================================================================
  //E4t ($0000,$09xx,$000F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のカラーが0でないとき
  //            4番目のカラー
  //          さもなくば(4番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):tpc(0)):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0)))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?epc(e3p())!=0?epc(e3p()):tpc(0):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:tpc(0):(v3=e2p())!=0?(v4=epc(v3))!=0?v4:tpc(0):(v6=e3p())!=0?(v7=epc(v6))!=0?v7:tpc(0):(v9=epc(e4p()))!=0?v9:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()))!=0?cto(p):tpo(0)
  E4t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t

  //================================================================================
  //XE4t
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    拡張あり
  XE4t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E4t_XWC
      case 0b00010001:  //E4t_XWC
      case 0b00010010:  //E4t_XWC
      case 0b00010011:  //E4t_XWC
        E4t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E4t_XWP
      case 0b00010101:  //E4t_XWP
      case 0b00010110:  //E4t_XWP
      case 0b00010111:  //E4t_XWP
        E4t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E4t_XHC
        E4t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E4t_XHCT
        E4t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E4t_XHCG
        E4t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E4t_XHCGT
        E4t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E4t_XHPT
        E4t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E4t_XHPG
        E4t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E4t_XHPGT
        E4t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E4t_A
      case 0b01000001:  //E4t_A
      case 0b01000010:  //E4t_A
      case 0b01000011:  //E4t_A
      case 0b01000100:  //E4t_A
      case 0b01000101:  //E4t_A
      case 0b01000110:  //E4t_A
      case 0b01000111:  //E4t_A
      case 0b01001000:  //E4t_A
      case 0b01001001:  //E4t_A
      case 0b01001010:  //E4t_A
      case 0b01001011:  //E4t_A
      case 0b01001100:  //E4t_A
      case 0b01001101:  //E4t_A
      case 0b01001110:  //E4t_A
      case 0b01001111:  //E4t_A
      case 0b01010000:  //E4t_A
      case 0b01010001:  //E4t_A
      case 0b01010010:  //E4t_A
      case 0b01010011:  //E4t_A
      case 0b01010100:  //E4t_A
      case 0b01010101:  //E4t_A
      case 0b01010110:  //E4t_A
      case 0b01010111:  //E4t_A
      case 0b01011000:  //E4t_A
      case 0b01011001:  //E4t_A
      case 0b01011010:  //E4t_A
      case 0b01011011:  //E4t_A
      case 0b01011100:  //E4t_A
      case 0b01011101:  //E4t_A
      case 0b01011110:  //E4t_A
      case 0b01011111:  //E4t_A
        E4t_A.drawRaster (src, dst, rh);
        break;
      default:
        E4t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE4t);
      }  //switch
    }  //drawRaster
  },  //XE4t

  //================================================================================
  //E4t_XWP ($0000,$09xx,$140F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0)))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=tev(e3p()))!=0?(v7=epc(v5))!=0?v7:tpc(0):(v9=epc(tev(e4p())))!=0?v9:tpc(0):v0==1?(v13=epc(0))!=0?v13:tpc(0):ls1(v0)==0?(v16=epc(v0))!=0?v16:tpc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):epo(p&-2)
  E4t_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_XWP

  //================================================================================
  //E4t_XHCT ($0000,$09xx,$190F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラーと
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラーと
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のカラーが0でないとき
  //              4番目のカラー
  //            さもなくば(4番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):epc(e3p())!=0?epc(e3p()):tpc(0):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(0)):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),tpc(0)):(v7=epc(v0))!=0?v7:tpc(0):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),tpc(0)):(v16=epc(v9))!=0?v16:tpc(0):(v18=e3p())!=0?ls1(epc(tev(v18)))!=0?mix(epc(v18),tpc(0)):(v25=epc(v18))!=0?v25:tpc(0):ls1(epc(tev(v30=e4p())))!=0?mix(epc(v30),tpc(0)):(v34=epc(v30))!=0?v34:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  E4t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_XHCT

  //================================================================================
  //E4t_XHCG ($0000,$09xx,$1A0F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //            さもなくば(4番目のパレットが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                テキストパレット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())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0)))))))
  //  中間コード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())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:tpc(0):(v13=epc(v0))!=0?v13:tpc(0):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):(v23=epc(v15))!=0?v23:tpc(0):(v25=e3p())!=0?ls1(v27=epc(tev(v25)))!=0?mix(v27,epc(1)):ls1(v25)!=0?(v32=epc(1))!=0?v32:tpc(0):(v34=epc(v25))!=0?v34:tpc(0):ls1(v37=epc(tev(v39=e4p())))!=0?mix(v37,epc(1)):ls1(v39)!=0?(v43=epc(1))!=0?v43:tpc(0):(v45=epc(v39))!=0?v45:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード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):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  E4t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_XHCG

  //================================================================================
  //E4t_XHCGT ($0000,$09xx,$1B0F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //            さもなくば(4番目のパレットが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(0)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0)))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(0)):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),tpc(0)):ls1(v0)!=0?(v11=epc(tod(e2q())))!=0?v11:tpc(0):(v15=epc(v0))!=0?v15:tpc(0):(v17=e2p())!=0?ls1(v19=epc(tev(v17)))!=0?mix(mix(v19,epc(tod(e2q()))),tpc(0)):(v27=epc(v17))!=0?v27:tpc(0):(v29=e3p())!=0?ls1(v31=epc(tev(v29)))!=0?mix(mix(v31,epc(1)),tpc(0)):ls1(v29)!=0?(v38=epc(1))!=0?v38:tpc(0):(v40=epc(v29))!=0?v40:tpc(0):ls1(v43=epc(tev(v45=e4p())))!=0?mix(mix(v43,epc(1)),tpc(0)):ls1(v45)!=0?(v51=epc(1))!=0?v51:tpc(0):(v53=epc(v45))!=0?v53:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),tpc(0)):ls1(p)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),tpc(0)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),tpc(0)):(p&1)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),tpc(0)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),tpc(0))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),tpc(0))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  E4t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_XHCGT

  //================================================================================
  //E4t_XHPT ($0000,$09xx,$1D0F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0)))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(epc(tev(e1p())),tpc(0)))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),tpc(0))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=tev(e3p()))!=0?(v7=epc(v5))!=0?v7:tpc(0):(v9=epc(tev(e4p())))!=0?v9:tpc(0):v0==1?(v13=epc(0))!=0?v13:tpc(0):ls1(v0)==0?(v16=epc(v0))!=0?v16:tpc(0):mix(epc(tev(v0)),tpc(0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(tev(p)),tpc(0))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(p&-2),tpc(0))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(epc(p&-2),tpc(0)))
  E4t_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_XHPT

  //================================================================================
  //E4t_XHPG ($0000,$09xx,$1E0F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0)))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=tev(e3p()))!=0?(v7=epc(v5))!=0?v7:tpc(0):(v9=epc(tev(e4p())))!=0?v9:tpc(0):v0==1?(v13=epc(0))!=0?v13:tpc(0):ls1(v0)==0?(v16=epc(v0))!=0?v16:tpc(0):(v18=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v18:tpc(0)
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(0)
  E4t_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_XHPG

  //================================================================================
  //E4t_XHPGT ($0000,$09xx,$1F0F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0)))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:tpc(0):(v5=tev(e3p()))!=0?(v7=epc(v5))!=0?v7:tpc(0):(v9=epc(tev(e4p())))!=0?v9:tpc(0):v0==1?(v13=epc(0))!=0?v13:tpc(0):ls1(v0)==0?(v16=epc(v0))!=0?v16:tpc(0):mix(mix(epc(tev(v0)),epc(tod(e2q()))),tpc(0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(0))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0)))
  E4t_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int 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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_XHPGT

  //================================================================================
  //E4t_A ($0000,$09xx,$400F)
  //  概要
  //    E4t  512ドット16色4プレーン＞テキスト(OFF)
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?mix(epc(e1p()),tpc(0)):(e2p()!=0?mix(epc(e2p()),tpc(0)):(e3p()!=0?mix(epc(e3p()),tpc(0)):mix(epc(e4p()),tpc(0)))))
  //  中間コード2
  //    e1p()!=0?mix(epc(e1p()),tpc(0)):e2p()!=0?mix(epc(e2p()),tpc(0)):e3p()!=0?mix(epc(e3p()),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード3
  //    (v0=e1p())!=0?mix(epc(v0),tpc(0)):(v4=e2p())!=0?mix(epc(v4),tpc(0)):(v8=e3p())!=0?mix(epc(v8),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード4
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):(p=e3p())!=0?mix(epc(p),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード5
  //    (p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):(p=e3p())!=0?mix(epc(p),tpc(0)):mix(epc(e4p()),tpc(0))
  //  中間コード6
  //    cto((p=e1p())!=0?mix(epc(p),tpc(0)):(p=e2p())!=0?mix(epc(p),tpc(0)):(p=e3p())!=0?mix(epc(p),tpc(0)):mix(epc(e4p()),tpc(0)))
  E4t_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4t_A

  //================================================================================
  //F1t ($0001,$09xx,$0003)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    1番目のカラーが0でないとき
  //      1番目のカラー
  //    さもなくば(1番目のカラーが0のとき)
  //      テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (fpc(f1p())!=0?fpc(f1p()):tpc(0))
  //  中間コード2
  //    fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    (v0=fpc(f1p()))!=0?v0:tpc(0)
  //  中間コード4
  //    (p=fpc(f1p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=fpc(f1p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=fpc(f1p()))!=0?cto(p):tpo(0)
  F1t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          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[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t

  //================================================================================
  //XF1t
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    拡張あり
  XF1t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F1t_XWC
      case 0b00010001:  //F1t_XWC
      case 0b00010010:  //F1t_XWC
      case 0b00010011:  //F1t_XWC
        F1t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F1t_XWP
      case 0b00010101:  //F1t_XWP
      case 0b00010110:  //F1t_XWP
      case 0b00010111:  //F1t_XWP
        F1t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F1t_XHC
        F1t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F1t_XHCT
        F1t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F1t_XHCG
        F1t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F1t_XHCGT
        F1t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F1t_XHPT
        F1t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F1t_XHPG
        F1t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F1t_XHPGT
        F1t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F1t_A
      case 0b01000001:  //F1t_A
      case 0b01000010:  //F1t_A
      case 0b01000011:  //F1t_A
      case 0b01000100:  //F1t_A
      case 0b01000101:  //F1t_A
      case 0b01000110:  //F1t_A
      case 0b01000111:  //F1t_A
      case 0b01001000:  //F1t_A
      case 0b01001001:  //F1t_A
      case 0b01001010:  //F1t_A
      case 0b01001011:  //F1t_A
      case 0b01001100:  //F1t_A
      case 0b01001101:  //F1t_A
      case 0b01001110:  //F1t_A
      case 0b01001111:  //F1t_A
      case 0b01010000:  //F1t_A
      case 0b01010001:  //F1t_A
      case 0b01010010:  //F1t_A
      case 0b01010011:  //F1t_A
      case 0b01010100:  //F1t_A
      case 0b01010101:  //F1t_A
      case 0b01010110:  //F1t_A
      case 0b01010111:  //F1t_A
      case 0b01011000:  //F1t_A
      case 0b01011001:  //F1t_A
      case 0b01011010:  //F1t_A
      case 0b01011011:  //F1t_A
      case 0b01011100:  //F1t_A
      case 0b01011101:  //F1t_A
      case 0b01011110:  //F1t_A
      case 0b01011111:  //F1t_A
        F1t_A.drawRaster (src, dst, rh);
        break;
      default:
        F1t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF1t);
      }  //switch
    }  //drawRaster
  },  //XF1t

  //================================================================================
  //F1t_XWP ($0001,$09xx,$1403)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=fpc(v0))!=0?v4:tpc(0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):fpo(p&-2)
  F1t_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_XWP

  //================================================================================
  //F1t_XHCT ($0001,$09xx,$1903)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0)))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(0)):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?mix(fpc(v3),tpc(0)):(v7=fpc(v3))!=0?v7:tpc(0)
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),tpc(0))):(q=fpc(p))!=0?cto(q):tpo(0)
  F1t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_XHCT

  //================================================================================
  //F1t_XHCG ($0001,$09xx,$1A03)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット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())):tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(v1,fpc(tod(f2q()))):ls1(v3)!=0?(v9=fpc(tod(f2q())))!=0?v9:tpc(0):(v13=fpc(v3))!=0?v13:tpc(0)
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(0):(p=fpc(q))!=0?cto(p):tpo(0)
  F1t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_XHCG

  //================================================================================
  //F1t_XHCGT ($0001,$09xx,$1B03)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0)):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0)):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(mix(v1,fpc(tod(f2q()))),tpc(0)):ls1(v3)!=0?(v11=fpc(tod(f2q())))!=0?v11:tpc(0):(v15=fpc(v3))!=0?v15:tpc(0)
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),tpc(0)):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),tpc(0)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),tpc(0))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(0):(p=fpc(q))!=0?cto(p):tpo(0)
  F1t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_XHCGT

  //================================================================================
  //F1t_XHPT ($0001,$09xx,$1D03)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):mix(fpc(tev(f1p())),tpc(0)))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):mix(fpc(tev(f1p())),tpc(0))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=fpc(v0))!=0?v4:tpc(0):mix(fpc(tev(v0)),tpc(0))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):mix(fpc(tev(p)),tpc(0))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):mix(fpc(p&-2),tpc(0))
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):cto(mix(fpc(p&-2),tpc(0)))
  F1t_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, 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[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_XHPT

  //================================================================================
  //F1t_XHPG ($0001,$09xx,$1E03)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):(mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):tpc(0)))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):tpc(0)
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=fpc(v0))!=0?v4:tpc(0):(v6=mix(fpc(tev(v0)),fpc(tod(f2q()))))!=0?v6:tpc(0)
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):(q=mix(fpc(tev(p)),fpc(tod(f2q()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?cto(q):tpo(0)
  F1t_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_XHPG

  //================================================================================
  //F1t_XHPGT ($0001,$09xx,$1F03)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0)))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:tpc(0):ls1(v0)==0?(v4=fpc(v0))!=0?v4:tpc(0):mix(mix(fpc(tev(v0)),fpc(tod(f2q()))),tpc(0))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):mix(mix(fpc(tev(p)),fpc(tod(f2q()))),tpc(0))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):mix(mix(fpc(p&-2),fpc(f2q()|1)),tpc(0))
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):cto(mix(mix(fpc(p&-2),fpc(f2q()|1)),tpc(0)))
  F1t_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_XHPGT

  //================================================================================
  //F1t_A ($0001,$09xx,$4003)
  //  概要
  //    F1t  512ドット256色1プレーン＞テキスト(OFF)
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード2
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード3
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード4
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード5
  //    mix(fpc(f1p()),tpc(0))
  //  中間コード6
  //    cto(mix(fpc(f1p()),tpc(0)))
  F1t_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st & 511])],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 1 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 2 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 3 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 4 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 5 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 6 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 7 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st & 511])],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 1 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 2 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 3 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 4 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 5 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 6 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gy1st | gx1st + 7 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1t_A

  //================================================================================
  //F2t ($0001,$09xx,$000F)
  //  概要
  //    F2t  512ドット256色2プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーが0でないとき
  //        2番目のカラー
  //      さもなくば(2番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):(fpc(f2p())!=0?fpc(f2p()):tpc(0)))
  //  中間コード2
  //    f1p()!=0?fpc(f1p())!=0?fpc(f1p()):tpc(0):fpc(f2p())!=0?fpc(f2p()):tpc(0)
  //  中間コード3
  //    (v0=f1p())!=0?(v1=fpc(v0))!=0?v1:tpc(0):(v3=fpc(f2p()))!=0?v3:tpc(0)
  //  中間コード4
  //    (p=f1p())!=0?(q=fpc(p))!=0?q:tpc(0):(p=fpc(f2p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=f1p())!=0?(q=fpc(p))!=0?q:tpc(0):(p=fpc(f2p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=f1p())!=0?(q=fpc(p))!=0?cto(q):tpo(0):(p=fpc(f2p()))!=0?cto(p):tpo(0)
  F2t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          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[0] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2t

  //================================================================================
  //XF2t
  //  概要
  //    F2t  512ドット256色2プレーン＞テキスト(OFF)
  //    拡張あり
  XF2t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F2t_XWC
      case 0b00010001:  //F2t_XWC
      case 0b00010010:  //F2t_XWC
      case 0b00010011:  //F2t_XWC
        F2t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F2t_XWP
      case 0b00010101:  //F2t_XWP
      case 0b00010110:  //F2t_XWP
      case 0b00010111:  //F2t_XWP
        F2t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F2t_XHC
        F2t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F2t_XHCT
        F2t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F2t_XHCG
        F2t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F2t_XHCGT
        F2t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F2t_XHPT
        F2t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F2t_XHPG
        F2t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F2t_XHPGT
        F2t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F2t_A
      case 0b01000001:  //F2t_A
      case 0b01000010:  //F2t_A
      case 0b01000011:  //F2t_A
      case 0b01000100:  //F2t_A
      case 0b01000101:  //F2t_A
      case 0b01000110:  //F2t_A
      case 0b01000111:  //F2t_A
      case 0b01001000:  //F2t_A
      case 0b01001001:  //F2t_A
      case 0b01001010:  //F2t_A
      case 0b01001011:  //F2t_A
      case 0b01001100:  //F2t_A
      case 0b01001101:  //F2t_A
      case 0b01001110:  //F2t_A
      case 0b01001111:  //F2t_A
      case 0b01010000:  //F2t_A
      case 0b01010001:  //F2t_A
      case 0b01010010:  //F2t_A
      case 0b01010011:  //F2t_A
      case 0b01010100:  //F2t_A
      case 0b01010101:  //F2t_A
      case 0b01010110:  //F2t_A
      case 0b01010111:  //F2t_A
      case 0b01011000:  //F2t_A
      case 0b01011001:  //F2t_A
      case 0b01011010:  //F2t_A
      case 0b01011011:  //F2t_A
      case 0b01011100:  //F2t_A
      case 0b01011101:  //F2t_A
      case 0b01011110:  //F2t_A
      case 0b01011111:  //F2t_A
        F2t_A.drawRaster (src, dst, rh);
        break;
      default:
        F2t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF2t);
      }  //switch
    }  //drawRaster
  },  //XF2t

  //================================================================================
  //F2t_XWP ($0001,$09xx,$140F)
  //  概要
  //    F2t  512ドット256色2プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?(fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(0)):f1p()==1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(0):f1p()==1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:tpc(0):v0==1?(v5=fpc(0))!=0?v5:tpc(0):ls1(v0)==0?(v8=fpc(v0))!=0?v8:tpc(0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:tpc(0):p==1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:tpc(0):p==1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):tpo(0):p==1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):fpo(p&-2)
  F2t_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2t_XWP

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

  //================================================================================
  //F2t_XHCG ($0001,$09xx,$1A0F)
  //  概要
  //    F2t  512ドット256色2プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレット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())):tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0)))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):(fpc(f2p())!=0?fpc(f2p()):tpc(0))))
  //  中間コード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())):tpc(0):fpc(f1p())!=0?fpc(f1p()):tpc(0):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())!=0?fpc(f2p()):tpc(0)
  //  中間コード3
  //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(v2,fpc(tod(f2q()))):ls1(v0)!=0?(v9=fpc(tod(f2q())))!=0?v9:tpc(0):(v13=fpc(v0))!=0?v13:tpc(0):ls1(v16=fpc(tev(v18=f2p())))!=0?mix(v16,fpc(tod(f2q()))):(v23=fpc(v18))!=0?v23:tpc(0)
  //  中間コード4
  //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(0):(q=fpc(p))!=0?q:tpc(0):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(0):(q=fpc(p))!=0?q:tpc(0):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード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):tpo(0):(q=fpc(p))!=0?cto(q):tpo(0):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(p=fpc(q))!=0?cto(p):tpo(0)
  F2t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz3rd = VideoController.vcnHidden3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz4th = VideoController.vcnHidden4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2t_XHCG

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

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

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

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

  //================================================================================
  //F2t_A ($0001,$09xx,$400F)
  //  概要
  //    F2t  512ドット256色2プレーン＞テキスト(OFF)
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?mix(fpc(f1p()),tpc(0)):mix(fpc(f2p()),tpc(0)))
  //  中間コード2
  //    f1p()!=0?mix(fpc(f1p()),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード3
  //    (v0=f1p())!=0?mix(fpc(v0),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード4
  //    (p=f1p())!=0?mix(fpc(p),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード5
  //    (p=f1p())!=0?mix(fpc(p),tpc(0)):mix(fpc(f2p()),tpc(0))
  //  中間コード6
  //    cto((p=f1p())!=0?mix(fpc(p),tpc(0)):mix(fpc(f2p()),tpc(0)))
  F2t_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd & 511])],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                              (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                    GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0]) :
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd & 511])],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                  (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                        GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0]) :
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2t_A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //Jt ($0007,$09xx,$0010)
  //  概要
  //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    1番目のカラーが0でないとき
  //      1番目のカラー
  //    さもなくば(1番目のカラーが0のとき)
  //      テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0))
  //  中間コード2
  //    jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)
  //  中間コード3
  //    (v0=jpc(v1=j1p(),v1))!=0?v0:tpc(0)
  //  中間コード4
  //    (p=jpc(q=j1p(),q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=jpc(q=j1p(),q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=jpc(q=j1p(),q))!=0?cto(p):tpo(0)
  Jt {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 1] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                          GraphicScreen.graM4[ga + 1])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 2] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                          GraphicScreen.graM4[ga + 2])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 3] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                          GraphicScreen.graM4[ga + 3])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 4] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                          GraphicScreen.graM4[ga + 4])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 5] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                          GraphicScreen.graM4[ga + 5])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 6] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                          GraphicScreen.graM4[ga + 6])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 7] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                          GraphicScreen.graM4[ga + 7])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                        GraphicScreen.graM4[ga])) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                      GraphicScreen.graM4[ga])) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 1] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                          GraphicScreen.graM4[ga + 1])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 2] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                          GraphicScreen.graM4[ga + 2])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 3] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                          GraphicScreen.graM4[ga + 3])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 4] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                          GraphicScreen.graM4[ga + 4])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 5] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                          GraphicScreen.graM4[ga + 5])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 6] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                          GraphicScreen.graM4[ga + 6])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            XEiJ.pnlBM[da + 7] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                          GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                          GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                          GraphicScreen.graM4[ga + 7])) >> 8] |
                                        VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (VideoController.vcnPal8G16H[(q = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                        GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                        GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                        GraphicScreen.graM4[ga])) >> 8] |
                                      VideoController.vcnPal8G16L[q & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //Jt

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

  //================================================================================
  //Jt_XWP ($0007,$09xx,$1410)
  //  概要
  //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):tpc(0)):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)):jpc(tev(j1p()),tev(j1p())))
  //  中間コード2
  //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):tpc(0):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0):jpc(tev(j1p()),tev(j1p()))
  //  中間コード3
  //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:tpc(0):ls1(v0)==0?(v4=jpc(v0,v0))!=0?v4:tpc(0):jpc(v7=tev(v0),v7)
  //  中間コード4
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):ls1(p)==0?(q=jpc(p,p))!=0?q:tpc(0):jpc(q=tev(p),q)
  //  中間コード5
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):(p&1)==0?(q=jpc(p,p))!=0?q:tpc(0):jpc(q=p&-2,q)
  //  中間コード6
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):tpo(0):(p&1)==0?(q=jpc(p,p))!=0?cto(q):tpo(0):jpo(q=p&-2,q)
  Jt_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                    VideoController.vcnPal8G16L[q & 255]]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                  VideoController.vcnPal8G16L[q & 255]]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //Jt_XWP

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

  //================================================================================
  //Jt_XHPT ($0007,$09xx,$1D10)
  //  概要
  //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        テキストパレット0のカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (j1p()<=1?(jpc(0,0)!=0?jpc(0,0):tpc(0)):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)):mix(jpc(tev(j1p()),tev(j1p())),tpc(0)))
  //  中間コード2
  //    j1p()<=1?jpc(0,0)!=0?jpc(0,0):tpc(0):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0):mix(jpc(tev(j1p()),tev(j1p())),tpc(0))
  //  中間コード3
  //    (v0=j1p())<=1?(v1=jpc(0,0))!=0?v1:tpc(0):ls1(v0)==0?(v4=jpc(v0,v0))!=0?v4:tpc(0):mix(jpc(v8=tev(v0),v8),tpc(0))
  //  中間コード4
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):ls1(p)==0?(q=jpc(p,p))!=0?q:tpc(0):mix(jpc(q=tev(p),q),tpc(0))
  //  中間コード5
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):(p&1)==0?(q=jpc(p,p))!=0?q:tpc(0):mix(jpc(q=p&-2,q),tpc(0))
  //  中間コード6
  //    (p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):tpo(0):(p&1)==0?(q=jpc(p,p))!=0?cto(q):tpo(0):cto(mix(jpc(q=p&-2,q),tpc(0)))
  Jt_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[0])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[0])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //Jt_XHPT

  //================================================================================
  //Jt_A ($0007,$09xx,$4010)
  //  概要
  //    Jt  1024ドット65536色1プレーン＞テキスト(OFF)
  //    A  グラフィックカラーとテキストパレット0のカラーを混ぜる
  //  手順
  //    1番目のカラーとテキストパレット0のカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    mix(jpc(j1p(),j1p()),tpc(0))
  //  中間コード2
  //    mix(jpc(j1p(),j1p()),tpc(0))
  //  中間コード3
  //    mix(jpc(v2=j1p(),v2),tpc(0))
  //  中間コード4
  //    mix(jpc(p=j1p(),p),tpc(0))
  //  中間コード5
  //    mix(jpc(p=j1p(),p),tpc(0))
  //  中間コード6
  //    cto(mix(jpc(p=j1p(),p),tpc(0)))
  Jt_A {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p;
            XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                     GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                     GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                     GraphicScreen.graM4[ga])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                         GraphicScreen.graM4[ga + 1])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                         GraphicScreen.graM4[ga + 2])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                         GraphicScreen.graM4[ga + 3])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                         GraphicScreen.graM4[ga + 4])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                         GraphicScreen.graM4[ga + 5])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                         GraphicScreen.graM4[ga + 6])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                         GraphicScreen.graM4[ga + 7])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p;
              XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                       GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                       GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                       GraphicScreen.graM4[ga])) >> 8] |
                                     VideoController.vcnPal8G16L[p & 255]),
                                    VideoController.vcnPal16TS[0])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p;
            XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                     GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                     GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                     GraphicScreen.graM4[ga])) >> 8] |
                                   VideoController.vcnPal8G16L[p & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097153] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048577] << 4 |
                                                                         GraphicScreen.graM4[ga + 1])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097154] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048578] << 4 |
                                                                         GraphicScreen.graM4[ga + 2])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097155] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048579] << 4 |
                                                                         GraphicScreen.graM4[ga + 3])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097156] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048580] << 4 |
                                                                         GraphicScreen.graM4[ga + 4])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097157] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048581] << 4 |
                                                                         GraphicScreen.graM4[ga + 5])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097158] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048582] << 4 |
                                                                         GraphicScreen.graM4[ga + 6])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = (VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                                                         GraphicScreen.graM4[ga + 2097159] << 8 |
                                                                         GraphicScreen.graM4[ga + 1048583] << 4 |
                                                                         GraphicScreen.graM4[ga + 7])) >> 8] |
                                       VideoController.vcnPal8G16L[p & 255]),
                                      VideoController.vcnPal16TS[0])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p;
              XEiJ.pnlBM[da] = (VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                                                       GraphicScreen.graM4[ga + 2097152] << 8 |
                                                                       GraphicScreen.graM4[ga + 1048576] << 4 |
                                                                       GraphicScreen.graM4[ga])) >> 8] |
                                     VideoController.vcnPal8G16L[p & 255]),
                                    VideoController.vcnPal16TS[0])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //Jt_A

  //================================================================================
  //TE1 ($0000,$06xx,$0021)
  //  概要
  //    TE1  テキスト＞512ドット16色1プレーン
  //    拡張なし
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):epc(e1p()))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):epc(e1p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:epc(e1p())
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:epc(e1p())
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:epc(e1p())
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):epo(e1p())
  TE1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1

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

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

  //================================================================================
  //TE1_XWP ($0000,$06xx,$1421)
  //  概要
  //    TE1  テキスト＞512ドット16色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?(tpc(txp())!=0?tpc(txp()):epc(0)):ls1(e1p())==0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):epc(tev(e1p())))
  //  中間コード2
  //    e1p()<=1?tpc(txp())!=0?tpc(txp()):epc(0):ls1(e1p())==0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=tpc(txp()))!=0?v1:epc(0):ls1(v0)==0?(v5=tpc(txp()))!=0?v5:epc(v0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())<=1?(p=tpc(txp()))!=0?p:epc(0):ls1(p)==0?(q=tpc(txp()))!=0?q:epc(p):epc(tev(p))
  //  中間コード5
  //    (p=e1p())<=1?(p=tpc(txp()))!=0?p:epc(0):(p&1)==0?(q=tpc(txp()))!=0?q:epc(p):epc(p&-2)
  //  中間コード6
  //    (p=e1p())<=1?(p=tpc(txp()))!=0?cto(p):epo(0):(p&1)==0?(q=tpc(txp()))!=0?cto(q):epo(p):epo(p&-2)
  TE1_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1_XWP

  //================================================================================
  //TE1_XHCT ($0000,$06xx,$1921)
  //  概要
  //    TE1  テキスト＞512ドット16色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:ls1(epc(tev(v5=e1p())))!=0?mix(epc(v5),0):epc(v5)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:ls1(epc(tev(p=e1p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(epc((p=e1p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  TE1_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1_XHCT

  //================================================================================
  //TE1_XHCG ($0000,$06xx,$1A21)
  //  概要
  //    TE1  テキスト＞512ドット16色1プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:ls1(v3=epc(tev(v5=e1p())))!=0?mix(v3,epc(tod(e2q()))):ls1(v5)!=0?epc(tod(e2q())):epc(v5)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?epc(tod(e2q())):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?epc(e2q()|1):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?epo(e2q()|1):epo(q)
  TE1_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1_XHCG

  //================================================================================
  //TE1_XHCGT ($0000,$06xx,$1B21)
  //  概要
  //    TE1  テキスト＞512ドット16色1プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:ls1(v3=epc(tev(v5=e1p())))!=0?mix(mix(v3,epc(tod(e2q()))),0):ls1(v5)!=0?epc(tod(e2q())):epc(v5)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),0):ls1(q)!=0?epc(tod(e2q())):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):(q&1)!=0?epc(e2q()|1):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):(q&1)!=0?epo(e2q()|1):epo(q)
  TE1_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1_XHCGT

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

  //================================================================================
  //TE1_XHPG ($0000,$06xx,$1E21)
  //  概要
  //    TE1  テキスト＞512ドット16色1プレーン
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q())))
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q())))
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1))
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1)))
  TE1_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1_XHPG

  //================================================================================
  //TE1_XHPGT ($0000,$06xx,$1F21)
  //  概要
  //    TE1  テキスト＞512ドット16色1プレーン
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0)
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0))
  TE1_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1_XHPGT

  //================================================================================
  //TE2 ($0000,$06xx,$0023)
  //  概要
  //    TE2  テキスト＞512ドット16色2プレーン
  //    拡張なし
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):epc(e2p())))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):epc(e2p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?epc(v2):epc(e2p())
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?epo(p):epo(e2p())
  TE2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2

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

  //================================================================================
  //TE2_XWC ($0000,$06xx,$1023)
  //  概要
  //    TE2  テキスト＞512ドット16色2プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(tpc(txp())!=0?tpc(txp()):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(tpc(txp())!=0?tpc(txp()):epc(e2p()))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p()):ls1(epc(tev(e2p())))!=0?epc(e2p()):tpc(txp())!=0?tpc(txp()):epc(e2p())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=tpc(txp()))!=0?v5:epc(v0):ls1(epc(tev(v11=e2p())))!=0?epc(v11):(v13=tpc(txp()))!=0?v13:epc(v11)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):ls1(epc(tev(p=e2p())))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(epc((p=e2p())&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p)
  TE2_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2_XWC

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

  //================================================================================
  //TE2_XHCT ($0000,$06xx,$1923)
  //  概要
  //    TE2  テキスト＞512ドット16色2プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):ls1(epc(tev(v12=e2p())))!=0?mix(epc(v12),0):epc(v12)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  TE2_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2_XHCT

  //================================================================================
  //TE2_XHCG ($0000,$06xx,$1A23)
  //  概要
  //    TE2  テキスト＞512ドット16色2プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v16=epc(tev(v18=e2p())))!=0?mix(v16,epc(tod(e2q()))):epc(v18)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):epo(q)
  TE2_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2_XHCG

  //================================================================================
  //TE2_XHCGT ($0000,$06xx,$1B23)
  //  概要
  //    TE2  テキスト＞512ドット16色2プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v17=epc(tev(v19=e2p())))!=0?mix(mix(v17,epc(tod(e2q()))),0):epc(v19)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),0):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):epo(q)
  TE2_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2_XHCGT

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

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

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

  //================================================================================
  //TE3 ($0000,$06xx,$0027)
  //  概要
  //    TE3  テキスト＞512ドット16色3プレーン
  //    拡張なし
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):epc(e3p()))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):epc(e3p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):epc(e3p())
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p())
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p())
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):epo(e3p())
  TE3 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3

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

  //================================================================================
  //TE3_XWC ($0000,$06xx,$1027)
  //  概要
  //    TE3  テキスト＞512ドット16色3プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            3番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(tpc(txp())!=0?tpc(txp()):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(tpc(txp())!=0?tpc(txp()):epc(e2p()))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(tpc(txp())!=0?tpc(txp()):epc(e3p())))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):tpc(txp())!=0?tpc(txp()):epc(e2p()):ls1(epc(tev(e3p())))!=0?epc(e3p()):tpc(txp())!=0?tpc(txp()):epc(e3p())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=tpc(txp()))!=0?v5:epc(v0):(v8=e2p())!=0?ls1(epc(tev(v8)))!=0?epc(v8):(v13=tpc(txp()))!=0?v13:epc(v8):ls1(epc(tev(v19=e3p())))!=0?epc(v19):(v21=tpc(txp()))!=0?v21:epc(v19)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):ls1(epc(tev(p=e3p())))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(epc((p=e3p())&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p)
  TE3_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3_XWC

  //================================================================================
  //TE3_XWP ($0000,$06xx,$1427)
  //  概要
  //    TE3  テキスト＞512ドット16色3プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(tpc(txp())!=0?tpc(txp()):((tev(e2p()))!=0?epc(tev(e2p())):epc(tev(e3p())))):e1p()==1?(tpc(txp())!=0?tpc(txp()):epc(0)):ls1(e1p())==0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?tpc(txp())!=0?tpc(txp()):tev(e2p())!=0?epc(tev(e2p())):epc(tev(e3p())):e1p()==1?tpc(txp())!=0?tpc(txp()):epc(0):ls1(e1p())==0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tpc(txp()))!=0?v1:(v3=tev(e2p()))!=0?epc(v3):epc(tev(e3p())):v0==1?(v9=tpc(txp()))!=0?v9:epc(0):ls1(v0)==0?(v13=tpc(txp()))!=0?v13:epc(v0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=tpc(txp()))!=0?p:(p=tev(e2p()))!=0?epc(p):epc(tev(e3p())):p==1?(p=tpc(txp()))!=0?p:epc(0):ls1(p)==0?(q=tpc(txp()))!=0?q:epc(p):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=tpc(txp()))!=0?p:(p=e2p()&-2)!=0?epc(p):epc(e3p()&-2):p==1?(p=tpc(txp()))!=0?p:epc(0):(p&1)==0?(q=tpc(txp()))!=0?q:epc(p):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=tpc(txp()))!=0?cto(p):(p=e2p()&-2)!=0?epo(p):epo(e3p()&-2):p==1?(p=tpc(txp()))!=0?cto(p):epo(0):(p&1)==0?(q=tpc(txp()))!=0?cto(q):epo(p):epo(p&-2)
  TE3_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                            p == 1 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                            p == 1 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                p == 1 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3_XWP

  //================================================================================
  //TE3_XHCT ($0000,$06xx,$1927)
  //  概要
  //    TE3  テキスト＞512ドット16色3プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):ls1(epc(tev(v19=e3p())))!=0?mix(epc(v19),0):epc(v19)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  TE3_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3_XHCT

  //================================================================================
  //TE3_XHCG ($0000,$06xx,$1A27)
  //  概要
  //    TE3  テキスト＞512ドット16色3プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):ls1(v25=epc(tev(v27=e3p())))!=0?mix(v25,epc(1)):ls1(v27)!=0?epc(1):epc(v27)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q)
  TE3_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3_XHCG

  //================================================================================
  //TE3_XHCGT ($0000,$06xx,$1B27)
  //  概要
  //    TE3  テキスト＞512ドット16色3プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):ls1(v27=epc(tev(v29=e3p())))!=0?mix(mix(v27,epc(1)),0):ls1(v29)!=0?epc(1):epc(v29)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q)
  TE3_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3_XHCGT

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

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

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

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

  //================================================================================
  //XTE4
  //  概要
  //    TE4  テキスト＞512ドット16色4プレーン
  //    拡張あり
  XTE4 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE4_XWC
      case 0b00010001:  //TE4_XWC
      case 0b00010010:  //TE4_XWC
      case 0b00010011:  //TE4_XWC
        TE4_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE4_XWP
      case 0b00010101:  //TE4_XWP
      case 0b00010110:  //TE4_XWP
      case 0b00010111:  //TE4_XWP
        TE4_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE4_XHC
        TE4.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE4_XHCT
        TE4_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE4_XHCG
        TE4_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE4_XHCGT
        TE4_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE4_XHPT
        TE4_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE4_XHPG
        TE4_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE4_XHPGT
        TE4_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE4_A
      case 0b01000001:  //TE4_A
      case 0b01000010:  //TE4_A
      case 0b01000011:  //TE4_A
      case 0b01000100:  //TE4_A
      case 0b01000101:  //TE4_A
      case 0b01000110:  //TE4_A
      case 0b01000111:  //TE4_A
      case 0b01001000:  //TE4_A
      case 0b01001001:  //TE4_A
      case 0b01001010:  //TE4_A
      case 0b01001011:  //TE4_A
      case 0b01001100:  //TE4_A
      case 0b01001101:  //TE4_A
      case 0b01001110:  //TE4_A
      case 0b01001111:  //TE4_A
      case 0b01010000:  //TE4_A
      case 0b01010001:  //TE4_A
      case 0b01010010:  //TE4_A
      case 0b01010011:  //TE4_A
      case 0b01010100:  //TE4_A
      case 0b01010101:  //TE4_A
      case 0b01010110:  //TE4_A
      case 0b01010111:  //TE4_A
      case 0b01011000:  //TE4_A
      case 0b01011001:  //TE4_A
      case 0b01011010:  //TE4_A
      case 0b01011011:  //TE4_A
      case 0b01011100:  //TE4_A
      case 0b01011101:  //TE4_A
      case 0b01011110:  //TE4_A
      case 0b01011111:  //TE4_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        TE4.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE4);
      }  //switch
    }  //drawRaster
  },  //XTE4

  //================================================================================
  //TE4_XWC ($0000,$06xx,$102F)
  //  概要
  //    TE4  テキスト＞512ドット16色4プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              4番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(tpc(txp())!=0?tpc(txp()):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(tpc(txp())!=0?tpc(txp()):epc(e2p()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(tpc(txp())!=0?tpc(txp()):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(tpc(txp())!=0?tpc(txp()):epc(e4p()))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):tpc(txp())!=0?tpc(txp()):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):tpc(txp())!=0?tpc(txp()):epc(e3p()):ls1(epc(tev(e4p())))!=0?epc(e4p()):tpc(txp())!=0?tpc(txp()):epc(e4p())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=tpc(txp()))!=0?v5:epc(v0):(v8=e2p())!=0?ls1(epc(tev(v8)))!=0?epc(v8):(v13=tpc(txp()))!=0?v13:epc(v8):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?epc(v16):(v21=tpc(txp()))!=0?v21:epc(v16):ls1(epc(tev(v27=e4p())))!=0?epc(v27):(v29=tpc(txp()))!=0?v29:epc(v27)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=tpc(txp()))!=0?q:epc(p)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=tpc(txp()))!=0?cto(q):epo(p)
  TE4_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4_XWC

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

  //================================================================================
  //TE4_XHCT ($0000,$06xx,$192F)
  //  概要
  //    TE4  テキスト＞512ドット16色4プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()))))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),0):epc(v16):ls1(epc(tev(v26=e4p())))!=0?mix(epc(v26),0):epc(v26)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  TE4_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4_XHCT

  //================================================================================
  //TE4_XHCG ($0000,$06xx,$1A2F)
  //  概要
  //    TE4  テキスト＞512ドット16色4プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(4番目のパレットが偶数のとき)
  //                4番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p())))))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):(v24=e3p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(1)):ls1(v24)!=0?epc(1):epc(v24):ls1(v34=epc(tev(v36=e4p())))!=0?mix(v34,epc(1)):ls1(v36)!=0?epc(1):epc(v36)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q)
  TE4_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4_XHCG

  //================================================================================
  //TE4_XHCGT ($0000,$06xx,$1B2F)
  //  概要
  //    TE4  テキスト＞512ドット16色4プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(4番目のパレットが偶数のとき)
  //                4番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p())))))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):(v26=e3p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(1)),0):ls1(v26)!=0?epc(1):epc(v26):ls1(v37=epc(tev(v39=e4p())))!=0?mix(mix(v37,epc(1)),0):ls1(v39)!=0?epc(1):epc(v39)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q)
  TE4_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4_XHCGT

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

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

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

  //================================================================================
  //TF1 ($0001,$06xx,$0023)
  //  概要
  //    TF1  テキスト＞512ドット256色1プレーン
  //    拡張なし
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):fpc(f1p()))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):fpc(f1p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:fpc(f1p())
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:fpc(f1p())
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:fpc(f1p())
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):fpo(f1p())
  TF1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1

  //================================================================================
  //XTF1
  //  概要
  //    TF1  テキスト＞512ドット256色1プレーン
  //    拡張あり
  XTF1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TF1_XWC
      case 0b00010001:  //TF1_XWC
      case 0b00010010:  //TF1_XWC
      case 0b00010011:  //TF1_XWC
        TF1_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TF1_XWP
      case 0b00010101:  //TF1_XWP
      case 0b00010110:  //TF1_XWP
      case 0b00010111:  //TF1_XWP
        TF1_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TF1_XHC
        TF1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TF1_XHCT
        TF1_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TF1_XHCG
        TF1_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TF1_XHCGT
        TF1_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TF1_XHPT
        TF1_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TF1_XHPG
        TF1_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TF1_XHPGT
        TF1_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TF1_A
      case 0b01000001:  //TF1_A
      case 0b01000010:  //TF1_A
      case 0b01000011:  //TF1_A
      case 0b01000100:  //TF1_A
      case 0b01000101:  //TF1_A
      case 0b01000110:  //TF1_A
      case 0b01000111:  //TF1_A
      case 0b01001000:  //TF1_A
      case 0b01001001:  //TF1_A
      case 0b01001010:  //TF1_A
      case 0b01001011:  //TF1_A
      case 0b01001100:  //TF1_A
      case 0b01001101:  //TF1_A
      case 0b01001110:  //TF1_A
      case 0b01001111:  //TF1_A
      case 0b01010000:  //TF1_A
      case 0b01010001:  //TF1_A
      case 0b01010010:  //TF1_A
      case 0b01010011:  //TF1_A
      case 0b01010100:  //TF1_A
      case 0b01010101:  //TF1_A
      case 0b01010110:  //TF1_A
      case 0b01010111:  //TF1_A
      case 0b01011000:  //TF1_A
      case 0b01011001:  //TF1_A
      case 0b01011010:  //TF1_A
      case 0b01011011:  //TF1_A
      case 0b01011100:  //TF1_A
      case 0b01011101:  //TF1_A
      case 0b01011110:  //TF1_A
      case 0b01011111:  //TF1_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        TF1.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTF1);
      }  //switch
    }  //drawRaster
  },  //XTF1

  //================================================================================
  //TF1_XWC ($0001,$06xx,$1023)
  //  概要
  //    TF1  テキスト＞512ドット256色1プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(tpc(txp())!=0?tpc(txp()):fpc(f1p())))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):tpc(txp())!=0?tpc(txp()):fpc(f1p())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=tpc(txp()))!=0?v5:fpc(v3)
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=tpc(txp()))!=0?q:fpc(p)
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=tpc(txp()))!=0?q:fpc(p)
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=tpc(txp()))!=0?cto(q):fpo(p)
  TF1_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1_XWC

  //================================================================================
  //TF1_XWP ($0001,$06xx,$1423)
  //  概要
  //    TF1  テキスト＞512ドット256色1プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(tpc(txp())!=0?tpc(txp()):fpc(0)):ls1(f1p())==0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?tpc(txp())!=0?tpc(txp()):fpc(0):ls1(f1p())==0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=tpc(txp()))!=0?v1:fpc(0):ls1(v0)==0?(v5=tpc(txp()))!=0?v5:fpc(v0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=tpc(txp()))!=0?p:fpc(0):ls1(p)==0?(q=tpc(txp()))!=0?q:fpc(p):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=tpc(txp()))!=0?p:fpc(0):(p&1)==0?(q=tpc(txp()))!=0?q:fpc(p):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=tpc(txp()))!=0?cto(p):fpo(0):(p&1)==0?(q=tpc(txp()))!=0?cto(q):fpo(p):fpo(p&-2)
  TF1_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                (p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1_XWP

  //================================================================================
  //TF1_XHCT ($0001,$06xx,$1923)
  //  概要
  //    TF1  テキスト＞512ドット256色1プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:ls1(fpc(tev(v5=f1p())))!=0?mix(fpc(v5),0):fpc(v5)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),0):fpc(p)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),0):fpc(p)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p)
  TF1_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1_XHCT

  //================================================================================
  //TF1_XHCG ($0001,$06xx,$1A23)
  //  概要
  //    TF1  テキスト＞512ドット256色1プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストカラーが0でないとき
  //      テキストカラー
  //    さもなくば(テキストカラーが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラー(0は黒)
  //  中間コード1
  //    (tpc(txp())!=0?tpc(txp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))))
  //  中間コード2
  //    tpc(txp())!=0?tpc(txp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())
  //  中間コード3
  //    (v0=tpc(txp()))!=0?v0:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(v3,fpc(tod(f2q()))):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5)
  //  中間コード4
  //    (p=tpc(txp()))!=0?p:ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?fpc(tod(f2q())):fpc(q)
  //  中間コード5
  //    (p=tpc(txp()))!=0?p:((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?fpc(f2q()|1):fpc(q)
  //  中間コード6
  //    (p=tpc(txp()))!=0?cto(p):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?fpo(f2q()|1):fpo(q)
  TF1_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16TS[tp >>> 28]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16TS[tp >>> 24 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16TS[tp >>> 20 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16TS[tp >>> 16 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16TS[tp >>> 12 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16TS[tp >>> 8 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16TS[tp >>> 4 & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16TS[tp & 15]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1_XHCG

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

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

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

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

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

  //================================================================================
  //XTF2
  //  概要
  //    TF2  テキスト＞512ドット256色2プレーン
  //    拡張あり
  XTF2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TF2_XWC
      case 0b00010001:  //TF2_XWC
      case 0b00010010:  //TF2_XWC
      case 0b00010011:  //TF2_XWC
        TF2_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TF2_XWP
      case 0b00010101:  //TF2_XWP
      case 0b00010110:  //TF2_XWP
      case 0b00010111:  //TF2_XWP
        TF2_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TF2_XHC
        TF2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TF2_XHCT
        TF2_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TF2_XHCG
        TF2_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TF2_XHCGT
        TF2_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TF2_XHPT
        TF2_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TF2_XHPG
        TF2_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TF2_XHPGT
        TF2_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TF2_A
      case 0b01000001:  //TF2_A
      case 0b01000010:  //TF2_A
      case 0b01000011:  //TF2_A
      case 0b01000100:  //TF2_A
      case 0b01000101:  //TF2_A
      case 0b01000110:  //TF2_A
      case 0b01000111:  //TF2_A
      case 0b01001000:  //TF2_A
      case 0b01001001:  //TF2_A
      case 0b01001010:  //TF2_A
      case 0b01001011:  //TF2_A
      case 0b01001100:  //TF2_A
      case 0b01001101:  //TF2_A
      case 0b01001110:  //TF2_A
      case 0b01001111:  //TF2_A
      case 0b01010000:  //TF2_A
      case 0b01010001:  //TF2_A
      case 0b01010010:  //TF2_A
      case 0b01010011:  //TF2_A
      case 0b01010100:  //TF2_A
      case 0b01010101:  //TF2_A
      case 0b01010110:  //TF2_A
      case 0b01010111:  //TF2_A
      case 0b01011000:  //TF2_A
      case 0b01011001:  //TF2_A
      case 0b01011010:  //TF2_A
      case 0b01011011:  //TF2_A
      case 0b01011100:  //TF2_A
      case 0b01011101:  //TF2_A
      case 0b01011110:  //TF2_A
      case 0b01011111:  //TF2_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        TF2.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTF2);
      }  //switch
    }  //drawRaster
  },  //XTF2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XE1ST
  //  概要
  //    E1ST  512ドット16色1プレーン＞スプライト＞テキスト
  //    拡張あり
  XE1ST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E1ST_XWC
      case 0b00010001:  //E1ST_XWC
      case 0b00010010:  //E1ST_XWC
      case 0b00010011:  //E1ST_XWC
        E1ST_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E1ST_XWP
      case 0b00010101:  //E1ST_XWP
      case 0b00010110:  //E1ST_XWP
      case 0b00010111:  //E1ST_XWP
        E1ST_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E1ST_XHC
        E1ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E1ST_XHCT
        E1ST_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E1ST_XHCG
        E1ST_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E1ST_XHCGT
        E1ST_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E1ST_XHPT
        E1ST_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E1ST_XHPG
        E1ST_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E1ST_XHPGT
        E1ST_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E1ST_A
      case 0b01000001:  //E1ST_A
      case 0b01000010:  //E1ST_A
      case 0b01000011:  //E1ST_A
      case 0b01000100:  //E1ST_A
      case 0b01000101:  //E1ST_A
      case 0b01000110:  //E1ST_A
      case 0b01000111:  //E1ST_A
      case 0b01001000:  //E1ST_A
      case 0b01001001:  //E1ST_A
      case 0b01001010:  //E1ST_A
      case 0b01001011:  //E1ST_A
      case 0b01001100:  //E1ST_A
      case 0b01001101:  //E1ST_A
      case 0b01001110:  //E1ST_A
      case 0b01001111:  //E1ST_A
      case 0b01010000:  //E1ST_A
      case 0b01010001:  //E1ST_A
      case 0b01010010:  //E1ST_A
      case 0b01010011:  //E1ST_A
      case 0b01010100:  //E1ST_A
      case 0b01010101:  //E1ST_A
      case 0b01010110:  //E1ST_A
      case 0b01010111:  //E1ST_A
      case 0b01011000:  //E1ST_A
      case 0b01011001:  //E1ST_A
      case 0b01011010:  //E1ST_A
      case 0b01011011:  //E1ST_A
      case 0b01011100:  //E1ST_A
      case 0b01011101:  //E1ST_A
      case 0b01011110:  //E1ST_A
      case 0b01011111:  //E1ST_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        E1ST.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE1ST);
      }  //switch
    }  //drawRaster
  },  //XE1ST

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

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

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

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

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

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

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

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

  //================================================================================
  //E2ST ($0000,$18xx,$0063)
  //  概要
  //    E2ST  512ドット16色2プレーン＞スプライト＞テキスト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーが0でないとき
  //        2番目のカラー
  //      さもなくば(2番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):(v7=epc(e2p()))!=0?v7:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11)
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e2p()))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e2p()))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(e2p()))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E2ST {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2ST

  //================================================================================
  //XE2ST
  //  概要
  //    E2ST  512ドット16色2プレーン＞スプライト＞テキスト
  //    拡張あり
  XE2ST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E2ST_XWC
      case 0b00010001:  //E2ST_XWC
      case 0b00010010:  //E2ST_XWC
      case 0b00010011:  //E2ST_XWC
        E2ST_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E2ST_XWP
      case 0b00010101:  //E2ST_XWP
      case 0b00010110:  //E2ST_XWP
      case 0b00010111:  //E2ST_XWP
        E2ST_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E2ST_XHC
        E2ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E2ST_XHCT
        E2ST_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E2ST_XHCG
        E2ST_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E2ST_XHCGT
        E2ST_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E2ST_XHPT
        E2ST_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E2ST_XHPG
        E2ST_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E2ST_XHPGT
        E2ST_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E2ST_A
      case 0b01000001:  //E2ST_A
      case 0b01000010:  //E2ST_A
      case 0b01000011:  //E2ST_A
      case 0b01000100:  //E2ST_A
      case 0b01000101:  //E2ST_A
      case 0b01000110:  //E2ST_A
      case 0b01000111:  //E2ST_A
      case 0b01001000:  //E2ST_A
      case 0b01001001:  //E2ST_A
      case 0b01001010:  //E2ST_A
      case 0b01001011:  //E2ST_A
      case 0b01001100:  //E2ST_A
      case 0b01001101:  //E2ST_A
      case 0b01001110:  //E2ST_A
      case 0b01001111:  //E2ST_A
      case 0b01010000:  //E2ST_A
      case 0b01010001:  //E2ST_A
      case 0b01010010:  //E2ST_A
      case 0b01010011:  //E2ST_A
      case 0b01010100:  //E2ST_A
      case 0b01010101:  //E2ST_A
      case 0b01010110:  //E2ST_A
      case 0b01010111:  //E2ST_A
      case 0b01011000:  //E2ST_A
      case 0b01011001:  //E2ST_A
      case 0b01011010:  //E2ST_A
      case 0b01011011:  //E2ST_A
      case 0b01011100:  //E2ST_A
      case 0b01011101:  //E2ST_A
      case 0b01011110:  //E2ST_A
      case 0b01011111:  //E2ST_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        E2ST.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE2ST);
      }  //switch
    }  //drawRaster
  },  //XE2ST

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

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

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

  //================================================================================
  //E2ST_XHCG ($0000,$18xx,$1A63)
  //  概要
  //    E2ST  512ドット16色2プレーン＞スプライト＞テキスト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが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())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))
  //  中間コード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())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=epc(v0))!=0?v17:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):ls1(v24=epc(tev(v26=e2p())))!=0?mix(v24,epc(tod(e2q()))):(v31=epc(v26))!=0?v31:ls4(v33=spp())!=0||(v34=txp())==0?spc(v33):tpc(v34)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):(p=epc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(p=epc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード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):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(p=epc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E2ST_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2ST_XHCG

  //================================================================================
  //E2ST_XHCGT ($0000,$18xx,$1B63)
  //  概要
  //    E2ST  512ドット16色2プレーン＞スプライト＞テキスト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11)):ls1(v0)!=0?(v15=epc(tod(e2q())))!=0?v15:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):(v23=epc(v0))!=0?v23:ls4(v25=spp())!=0||(v26=txp())==0?spc(v25):tpc(v26):ls1(v30=epc(tev(v32=e2p())))!=0?mix(mix(v30,epc(tod(e2q()))),ls4(v39=spp())!=0||(v40=txp())==0?spc(v39):tpc(v40)):(v43=epc(v32))!=0?v43:ls4(v45=spp())!=0||(v46=txp())==0?spc(v45):tpc(v46)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(p=epc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(p=epc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(p=epc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E2ST_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2ST_XHCGT

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

  //================================================================================
  //E2ST_XHPG ($0000,$18xx,$1E63)
  //  概要
  //    E2ST  512ドット16色2プレーン＞スプライト＞テキスト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):e1p()==1?(epc(0)!=0?epc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:ls4(v5=spp())!=0||(v6=txp())==0?spc(v5):tpc(v6):v0==1?(v9=epc(0))!=0?v9:ls4(v11=spp())!=0||(v12=txp())==0?spc(v11):tpc(v12):ls1(v0)==0?(v16=epc(v0))!=0?v16:ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19):(v22=mix(epc(tev(v0)),epc(tod(e2p()))))!=0?v22:ls4(v29=spp())!=0||(v30=txp())==0?spc(v29):tpc(v30)
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=mix(epc(tev(p)),epc(tod(e2p()))))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):p==1?(p=epc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E2ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2ST_XHPG

  //================================================================================
  //E2ST_XHPGT ($0000,$18xx,$1F63)
  //  概要
  //    E2ST  512ドット16色2プレーン＞スプライト＞テキスト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):e1p()==1?(epc(0)!=0?epc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:ls4(v5=spp())!=0||(v6=txp())==0?spc(v5):tpc(v6):v0==1?(v9=epc(0))!=0?v9:ls4(v11=spp())!=0||(v12=txp())==0?spc(v11):tpc(v12):ls1(v0)==0?(v16=epc(v0))!=0?v16:ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19):mix(mix(epc(tev(v0)),epc(tod(e2p()))),ls4(v30=spp())!=0||(v31=txp())==0?spc(v30):tpc(v31))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):mix(mix(epc(tev(p)),epc(tod(e2p()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):mix(mix(epc(p&-2),epc(e2p()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):p==1?(p=epc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):cto(mix(mix(epc(p&-2),epc(e2p()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)))
  E2ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2ST_XHPGT

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

  //================================================================================
  //XE3ST
  //  概要
  //    E3ST  512ドット16色3プレーン＞スプライト＞テキスト
  //    拡張あり
  XE3ST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E3ST_XWC
      case 0b00010001:  //E3ST_XWC
      case 0b00010010:  //E3ST_XWC
      case 0b00010011:  //E3ST_XWC
        E3ST_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E3ST_XWP
      case 0b00010101:  //E3ST_XWP
      case 0b00010110:  //E3ST_XWP
      case 0b00010111:  //E3ST_XWP
        E3ST_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E3ST_XHC
        E3ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E3ST_XHCT
        E3ST_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E3ST_XHCG
        E3ST_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E3ST_XHCGT
        E3ST_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E3ST_XHPT
        E3ST_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E3ST_XHPG
        E3ST_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E3ST_XHPGT
        E3ST_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E3ST_A
      case 0b01000001:  //E3ST_A
      case 0b01000010:  //E3ST_A
      case 0b01000011:  //E3ST_A
      case 0b01000100:  //E3ST_A
      case 0b01000101:  //E3ST_A
      case 0b01000110:  //E3ST_A
      case 0b01000111:  //E3ST_A
      case 0b01001000:  //E3ST_A
      case 0b01001001:  //E3ST_A
      case 0b01001010:  //E3ST_A
      case 0b01001011:  //E3ST_A
      case 0b01001100:  //E3ST_A
      case 0b01001101:  //E3ST_A
      case 0b01001110:  //E3ST_A
      case 0b01001111:  //E3ST_A
      case 0b01010000:  //E3ST_A
      case 0b01010001:  //E3ST_A
      case 0b01010010:  //E3ST_A
      case 0b01010011:  //E3ST_A
      case 0b01010100:  //E3ST_A
      case 0b01010101:  //E3ST_A
      case 0b01010110:  //E3ST_A
      case 0b01010111:  //E3ST_A
      case 0b01011000:  //E3ST_A
      case 0b01011001:  //E3ST_A
      case 0b01011010:  //E3ST_A
      case 0b01011011:  //E3ST_A
      case 0b01011100:  //E3ST_A
      case 0b01011101:  //E3ST_A
      case 0b01011110:  //E3ST_A
      case 0b01011111:  //E3ST_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        E3ST.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE3ST);
      }  //switch
    }  //drawRaster
  },  //XE3ST

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

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

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

  //================================================================================
  //E3ST_XHCG ($0000,$18xx,$1A67)
  //  概要
  //    E3ST  512ドット16色3プレーン＞スプライト＞テキスト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが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())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e3p())!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))))
  //  中間コード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())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e3p())!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=epc(v0))!=0?v17:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):(v23=e2p())!=0?ls1(v25=epc(tev(v23)))!=0?mix(v25,epc(tod(e2q()))):(v31=epc(v23))!=0?v31:ls4(v33=spp())!=0||(v34=txp())==0?spc(v33):tpc(v34):ls1(v38=epc(tev(v40=e3p())))!=0?mix(v38,epc(1)):ls1(v40)!=0?(v44=epc(1))!=0?v44:ls4(v46=spp())!=0||(v47=txp())==0?spc(v46):tpc(v47):(v50=epc(v40))!=0?v50:ls4(v52=spp())!=0||(v53=txp())==0?spc(v52):tpc(v53)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード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):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E3ST_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3ST_XHCG

  //================================================================================
  //E3ST_XHCGT ($0000,$18xx,$1B67)
  //  概要
  //    E3ST  512ドット16色3プレーン＞スプライト＞テキスト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e3p())!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ls1(e3p())!=0?epc(1)!=0?epc(1):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e3p())!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11)):ls1(v0)!=0?(v15=epc(tod(e2q())))!=0?v15:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):(v23=epc(v0))!=0?v23:ls4(v25=spp())!=0||(v26=txp())==0?spc(v25):tpc(v26):(v29=e2p())!=0?ls1(v31=epc(tev(v29)))!=0?mix(mix(v31,epc(tod(e2q()))),ls4(v39=spp())!=0||(v40=txp())==0?spc(v39):tpc(v40)):(v43=epc(v29))!=0?v43:ls4(v45=spp())!=0||(v46=txp())==0?spc(v45):tpc(v46):ls1(v50=epc(tev(v52=e3p())))!=0?mix(mix(v50,epc(1)),ls4(v57=spp())!=0||(v58=txp())==0?spc(v57):tpc(v58)):ls1(v52)!=0?(v62=epc(1))!=0?v62:ls4(v64=spp())!=0||(v65=txp())==0?spc(v64):tpc(v65):(v68=epc(v52))!=0?v68:ls4(v70=spp())!=0||(v71=txp())==0?spc(v70):tpc(v71)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):ls1(q)!=0?(p=epc(1))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q&1)!=0?(p=epc(1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q&1)!=0?(p=epc(1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E3ST_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3ST_XHCGT

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

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

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

  //================================================================================
  //E4ST ($0000,$18xx,$006F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のカラーが0でないとき
  //            4番目のカラー
  //          さもなくば(4番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e4p())!=0?epc(e4p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e2p()!=0?epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e3p()!=0?epc(e3p())!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e4p())!=0?epc(e4p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):(v7=e2p())!=0?(v8=epc(v7))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):(v14=e3p())!=0?(v15=epc(v14))!=0?v15:ls4(v17=spp())!=0||(v18=txp())==0?spc(v17):tpc(v18):(v21=epc(e4p()))!=0?v21:ls4(v24=spp())!=0||(v25=txp())==0?spc(v24):tpc(v25)
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e4p()))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e4p()))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e2p())!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p())!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(e4p()))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E4ST {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST

  //================================================================================
  //XE4ST
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    拡張あり
  XE4ST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E4ST_XWC
      case 0b00010001:  //E4ST_XWC
      case 0b00010010:  //E4ST_XWC
      case 0b00010011:  //E4ST_XWC
        E4ST_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E4ST_XWP
      case 0b00010101:  //E4ST_XWP
      case 0b00010110:  //E4ST_XWP
      case 0b00010111:  //E4ST_XWP
        E4ST_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E4ST_XHC
        E4ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E4ST_XHCT
        E4ST_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E4ST_XHCG
        E4ST_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E4ST_XHCGT
        E4ST_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E4ST_XHPT
        E4ST_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E4ST_XHPG
        E4ST_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E4ST_XHPGT
        E4ST_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E4ST_A
      case 0b01000001:  //E4ST_A
      case 0b01000010:  //E4ST_A
      case 0b01000011:  //E4ST_A
      case 0b01000100:  //E4ST_A
      case 0b01000101:  //E4ST_A
      case 0b01000110:  //E4ST_A
      case 0b01000111:  //E4ST_A
      case 0b01001000:  //E4ST_A
      case 0b01001001:  //E4ST_A
      case 0b01001010:  //E4ST_A
      case 0b01001011:  //E4ST_A
      case 0b01001100:  //E4ST_A
      case 0b01001101:  //E4ST_A
      case 0b01001110:  //E4ST_A
      case 0b01001111:  //E4ST_A
      case 0b01010000:  //E4ST_A
      case 0b01010001:  //E4ST_A
      case 0b01010010:  //E4ST_A
      case 0b01010011:  //E4ST_A
      case 0b01010100:  //E4ST_A
      case 0b01010101:  //E4ST_A
      case 0b01010110:  //E4ST_A
      case 0b01010111:  //E4ST_A
      case 0b01011000:  //E4ST_A
      case 0b01011001:  //E4ST_A
      case 0b01011010:  //E4ST_A
      case 0b01011011:  //E4ST_A
      case 0b01011100:  //E4ST_A
      case 0b01011101:  //E4ST_A
      case 0b01011110:  //E4ST_A
      case 0b01011111:  //E4ST_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        E4ST.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE4ST);
      }  //switch
    }  //drawRaster
  },  //XE4ST

  //================================================================================
  //E4ST_XWC ($0000,$18xx,$106F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のカラーが0でないとき
  //              4番目のカラー
  //            さもなくば(4番目のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(epc(e3p())!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(epc(e4p())!=0?epc(e4p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):epc(e3p())!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e4p())))!=0?epc(e4p()):epc(e4p())!=0?epc(e4p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?epc(v11):(v16=epc(v11))!=0?v16:ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19):(v22=e3p())!=0?ls1(epc(tev(v22)))!=0?epc(v22):(v27=epc(v22))!=0?v27:ls4(v29=spp())!=0||(v30=txp())==0?spc(v29):tpc(v30):ls1(epc(tev(v36=e4p())))!=0?epc(v36):(v38=epc(v36))!=0?v38:ls4(v40=spp())!=0||(v41=txp())==0?spc(v40):tpc(v41)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XWC

  //================================================================================
  //E4ST_XWP ($0000,$18xx,$146F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):e1p()==1?(epc(0)!=0?epc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:ls4(v5=spp())!=0||(v6=txp())==0?spc(v5):tpc(v6):(v9=tev(e3p()))!=0?(v11=epc(v9))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=epc(tev(e4p())))!=0?v17:ls4(v21=spp())!=0||(v22=txp())==0?spc(v21):tpc(v22):v0==1?(v25=epc(0))!=0?v25:ls4(v27=spp())!=0||(v28=txp())==0?spc(v27):tpc(v28):ls1(v0)==0?(v32=epc(v0))!=0?v32:ls4(v34=spp())!=0||(v35=txp())==0?spc(v34):tpc(v35):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(tev(e4p())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e4p()&-2))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(e4p()&-2))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):p==1?(p=epc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):epo(p&-2)
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XWP

  //================================================================================
  //E4ST_XHCT ($0000,$18xx,$196F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーと
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラーと
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラーと
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のカラーが0でないとき
  //              4番目のカラー
  //            さもなくば(4番目のカラーが0のとき)
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e3p())!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e4p())!=0?epc(e4p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):epc(e3p())!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):epc(e4p())!=0?epc(e4p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)):(v11=epc(v0))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=e2p())!=0?ls1(epc(tev(v17)))!=0?mix(epc(v17),ls4(v24=spp())!=0||(v25=txp())==0?spc(v24):tpc(v25)):(v28=epc(v17))!=0?v28:ls4(v30=spp())!=0||(v31=txp())==0?spc(v30):tpc(v31):(v34=e3p())!=0?ls1(epc(tev(v34)))!=0?mix(epc(v34),ls4(v41=spp())!=0||(v42=txp())==0?spc(v41):tpc(v42)):(v45=epc(v34))!=0?v45:ls4(v47=spp())!=0||(v48=txp())==0?spc(v47):tpc(v48):ls1(epc(tev(v54=e4p())))!=0?mix(epc(v54),ls4(v58=spp())!=0||(v59=txp())==0?spc(v58):tpc(v59)):(v62=epc(v54))!=0?v62:ls4(v64=spp())!=0||(v65=txp())==0?spc(v64):tpc(v65)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XHCT

  //================================================================================
  //E4ST_XHCG ($0000,$18xx,$1A6F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                  テキストカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                  テキストカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                  テキストカラー(0は黒)
  //            さもなくば(4番目のパレットが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが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())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e3p())!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e4p())!=0?epc(e4p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))))))
  //  中間コード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())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e3p())!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e4p())!=0?epc(e4p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(v2,epc(tod(e2q()))):ls1(v0)!=0?(v9=epc(tod(e2q())))!=0?v9:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=epc(v0))!=0?v17:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):(v23=e2p())!=0?ls1(v25=epc(tev(v23)))!=0?mix(v25,epc(tod(e2q()))):(v31=epc(v23))!=0?v31:ls4(v33=spp())!=0||(v34=txp())==0?spc(v33):tpc(v34):(v37=e3p())!=0?ls1(v39=epc(tev(v37)))!=0?mix(v39,epc(1)):ls1(v37)!=0?(v44=epc(1))!=0?v44:ls4(v46=spp())!=0||(v47=txp())==0?spc(v46):tpc(v47):(v50=epc(v37))!=0?v50:ls4(v52=spp())!=0||(v53=txp())==0?spc(v52):tpc(v53):ls1(v57=epc(tev(v59=e4p())))!=0?mix(v57,epc(1)):ls1(v59)!=0?(v63=epc(1))!=0?v63:ls4(v65=spp())!=0||(v66=txp())==0?spc(v65):tpc(v66):(v69=epc(v59))!=0?v69:ls4(v71=spp())!=0||(v72=txp())==0?spc(v71):tpc(v72)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード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):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?(p=epc(1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XHCG

  //================================================================================
  //E4ST_XHCGT ($0000,$18xx,$1B6F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                  テキストカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                  テキストカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                スプライトカラー(0は黒)
  //              さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                テキストカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                  テキストカラー(0は黒)
  //            さもなくば(4番目のパレットが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //                  スプライトカラー(0は黒)
  //                さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //                  テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e2p())!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e3p())!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ls1(e4p())!=0?(epc(1)!=0?epc(1):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(e4p())!=0?epc(e4p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):epc(e2p())!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ls1(e3p())!=0?epc(1)!=0?epc(1):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e3p())!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ls1(e4p())!=0?epc(1)!=0?epc(1):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(e4p())!=0?epc(e4p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11)):ls1(v0)!=0?(v15=epc(tod(e2q())))!=0?v15:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):(v23=epc(v0))!=0?v23:ls4(v25=spp())!=0||(v26=txp())==0?spc(v25):tpc(v26):(v29=e2p())!=0?ls1(v31=epc(tev(v29)))!=0?mix(mix(v31,epc(tod(e2q()))),ls4(v39=spp())!=0||(v40=txp())==0?spc(v39):tpc(v40)):(v43=epc(v29))!=0?v43:ls4(v45=spp())!=0||(v46=txp())==0?spc(v45):tpc(v46):(v49=e3p())!=0?ls1(v51=epc(tev(v49)))!=0?mix(mix(v51,epc(1)),ls4(v57=spp())!=0||(v58=txp())==0?spc(v57):tpc(v58)):ls1(v49)!=0?(v62=epc(1))!=0?v62:ls4(v64=spp())!=0||(v65=txp())==0?spc(v64):tpc(v65):(v68=epc(v49))!=0?v68:ls4(v70=spp())!=0||(v71=txp())==0?spc(v70):tpc(v71):ls1(v75=epc(tev(v77=e4p())))!=0?mix(mix(v75,epc(1)),ls4(v82=spp())!=0||(v83=txp())==0?spc(v82):tpc(v83)):ls1(v77)!=0?(v87=epc(1))!=0?v87:ls4(v89=spp())!=0||(v90=txp())==0?spc(v89):tpc(v90):(v93=epc(v77))!=0?v93:ls4(v95=spp())!=0||(v96=txp())==0?spc(v95):tpc(v96)
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):ls1(p)!=0?(p=epc(1))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):ls1(q)!=0?(p=epc(1))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(p&1)!=0?(p=epc(1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q&1)!=0?(p=epc(1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(p&1)!=0?(p=epc(1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q&1)!=0?(p=epc(1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XHCGT

  //================================================================================
  //E4ST_XHPT ($0000,$18xx,$1D6F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):e1p()==1?(epc(0)!=0?epc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):mix(epc(tev(e1p())),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(epc(tev(e1p())),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:ls4(v5=spp())!=0||(v6=txp())==0?spc(v5):tpc(v6):(v9=tev(e3p()))!=0?(v11=epc(v9))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=epc(tev(e4p())))!=0?v17:ls4(v21=spp())!=0||(v22=txp())==0?spc(v21):tpc(v22):v0==1?(v25=epc(0))!=0?v25:ls4(v27=spp())!=0||(v28=txp())==0?spc(v27):tpc(v28):ls1(v0)==0?(v32=epc(v0))!=0?v32:ls4(v34=spp())!=0||(v35=txp())==0?spc(v34):tpc(v35):mix(epc(tev(v0)),ls4(v42=spp())!=0||(v43=txp())==0?spc(v42):tpc(v43))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(tev(e4p())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):mix(epc(tev(p)),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e4p()&-2))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):mix(epc(p&-2),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(e4p()&-2))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):p==1?(p=epc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):cto(mix(epc(p&-2),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)))
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XHPT

  //================================================================================
  //E4ST_XHPG ($0000,$18xx,$1E6F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):e1p()==1?(epc(0)!=0?epc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:ls4(v5=spp())!=0||(v6=txp())==0?spc(v5):tpc(v6):(v9=tev(e3p()))!=0?(v11=epc(v9))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=epc(tev(e4p())))!=0?v17:ls4(v21=spp())!=0||(v22=txp())==0?spc(v21):tpc(v22):v0==1?(v25=epc(0))!=0?v25:ls4(v27=spp())!=0||(v28=txp())==0?spc(v27):tpc(v28):ls1(v0)==0?(v32=epc(v0))!=0?v32:ls4(v34=spp())!=0||(v35=txp())==0?spc(v34):tpc(v35):(v38=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v38:ls4(v45=spp())!=0||(v46=txp())==0?spc(v45):tpc(v46)
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(tev(e4p())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e4p()&-2))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(e4p()&-2))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):p==1?(p=epc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XHPG

  //================================================================================
  //E4ST_XHPGT ($0000,$18xx,$1F6F)
  //  概要
  //    E4ST  512ドット16色4プレーン＞スプライト＞テキスト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):e1p()==1?(epc(0)!=0?epc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:ls4(v5=spp())!=0||(v6=txp())==0?spc(v5):tpc(v6):(v9=tev(e3p()))!=0?(v11=epc(v9))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=epc(tev(e4p())))!=0?v17:ls4(v21=spp())!=0||(v22=txp())==0?spc(v21):tpc(v22):v0==1?(v25=epc(0))!=0?v25:ls4(v27=spp())!=0||(v28=txp())==0?spc(v27):tpc(v28):ls1(v0)==0?(v32=epc(v0))!=0?v32:ls4(v34=spp())!=0||(v35=txp())==0?spc(v34):tpc(v35):mix(mix(epc(tev(v0)),epc(tod(e2q()))),ls4(v46=spp())!=0||(v47=txp())==0?spc(v46):tpc(v47))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(tev(e4p())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=epc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):mix(mix(epc(tev(p)),epc(tod(e2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=epc(e4p()&-2))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=epc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=epc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):mix(mix(epc(p&-2),epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=epc(e4p()&-2))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):p==1?(p=epc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=epc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):cto(mix(mix(epc(p&-2),epc(e2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)))
  E4ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4ST_XHPGT

  //================================================================================
  //F1ST ($0001,$18xx,$0063)
  //  概要
  //    F1ST  512ドット256色1プレーン＞スプライト＞テキスト
  //    拡張なし
  //  手順
  //    1番目のカラーが0でないとき
  //      1番目のカラー
  //    さもなくば(1番目のカラーが0のとき)
  //      スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //        スプライトカラー(0は黒)
  //      さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //        テキストカラー(0は黒)
  //  中間コード1
  //    (fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))
  //  中間コード2
  //    fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=fpc(f1p()))!=0?v0:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4)
  //  中間コード4
  //    (p=fpc(f1p()))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=fpc(f1p()))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=fpc(f1p()))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F1ST {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 1] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 2] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 3] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 4] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 5] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 6] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          XEiJ.pnlBM[da + 7] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1ST

  //================================================================================
  //XF1ST
  //  概要
  //    F1ST  512ドット256色1プレーン＞スプライト＞テキスト
  //    拡張あり
  XF1ST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F1ST_XWC
      case 0b00010001:  //F1ST_XWC
      case 0b00010010:  //F1ST_XWC
      case 0b00010011:  //F1ST_XWC
        F1ST_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F1ST_XWP
      case 0b00010101:  //F1ST_XWP
      case 0b00010110:  //F1ST_XWP
      case 0b00010111:  //F1ST_XWP
        F1ST_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F1ST_XHC
        F1ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F1ST_XHCT
        F1ST_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F1ST_XHCG
        F1ST_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F1ST_XHCGT
        F1ST_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F1ST_XHPT
        F1ST_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F1ST_XHPG
        F1ST_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F1ST_XHPGT
        F1ST_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F1ST_A
      case 0b01000001:  //F1ST_A
      case 0b01000010:  //F1ST_A
      case 0b01000011:  //F1ST_A
      case 0b01000100:  //F1ST_A
      case 0b01000101:  //F1ST_A
      case 0b01000110:  //F1ST_A
      case 0b01000111:  //F1ST_A
      case 0b01001000:  //F1ST_A
      case 0b01001001:  //F1ST_A
      case 0b01001010:  //F1ST_A
      case 0b01001011:  //F1ST_A
      case 0b01001100:  //F1ST_A
      case 0b01001101:  //F1ST_A
      case 0b01001110:  //F1ST_A
      case 0b01001111:  //F1ST_A
      case 0b01010000:  //F1ST_A
      case 0b01010001:  //F1ST_A
      case 0b01010010:  //F1ST_A
      case 0b01010011:  //F1ST_A
      case 0b01010100:  //F1ST_A
      case 0b01010101:  //F1ST_A
      case 0b01010110:  //F1ST_A
      case 0b01010111:  //F1ST_A
      case 0b01011000:  //F1ST_A
      case 0b01011001:  //F1ST_A
      case 0b01011010:  //F1ST_A
      case 0b01011011:  //F1ST_A
      case 0b01011100:  //F1ST_A
      case 0b01011101:  //F1ST_A
      case 0b01011110:  //F1ST_A
      case 0b01011111:  //F1ST_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        F1ST.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF1ST);
      }  //switch
    }  //drawRaster
  },  //XF1ST

  //================================================================================
  //F1ST_XWC ($0001,$18xx,$1063)
  //  概要
  //    F1ST  512ドット256色1プレーン＞スプライト＞テキスト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=fpc(v3))!=0?v5:ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F1ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1ST_XWC

  //================================================================================
  //F1ST_XWP ($0001,$18xx,$1463)
  //  概要
  //    F1ST  512ドット256色1プレーン＞スプライト＞テキスト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(fpc(0)!=0?fpc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:ls4(v3=spp())!=0||(v4=txp())==0?spc(v3):tpc(v4):ls1(v0)==0?(v8=fpc(v0))!=0?v8:ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):fpo(p&-2)
  F1ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1ST_XWP

  //================================================================================
  //F1ST_XHCT ($0001,$18xx,$1963)
  //  概要
  //    F1ST  512ドット256色1プレーン＞スプライト＞テキスト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーと
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?mix(fpc(v3),ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)):(v11=fpc(v3))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14)
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F1ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1ST_XHCT

  //================================================================================
  //F1ST_XHCG ($0001,$18xx,$1A63)
  //  概要
  //    F1ST  512ドット256色1プレーン＞スプライト＞テキスト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが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())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(v1,fpc(tod(f2q()))):ls1(v3)!=0?(v9=fpc(tod(f2q())))!=0?v9:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=fpc(v3))!=0?v17:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20)
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=fpc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=fpc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=fpc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F1ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1ST_XHCG

  //================================================================================
  //F1ST_XHCGT ($0001,$18xx,$1B63)
  //  概要
  //    F1ST  512ドット256色1プレーン＞スプライト＞テキスト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(mix(v1,fpc(tod(f2q()))),ls4(v10=spp())!=0||(v11=txp())==0?spc(v10):tpc(v11)):ls1(v3)!=0?(v15=fpc(tod(f2q())))!=0?v15:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):(v23=fpc(v3))!=0?v23:ls4(v25=spp())!=0||(v26=txp())==0?spc(v25):tpc(v26)
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(p=fpc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p=fpc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p=fpc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F1ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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]),
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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]),
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1ST_XHCGT

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

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

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

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

  //================================================================================
  //XF2ST
  //  概要
  //    F2ST  512ドット256色2プレーン＞スプライト＞テキスト
  //    拡張あり
  XF2ST {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F2ST_XWC
      case 0b00010001:  //F2ST_XWC
      case 0b00010010:  //F2ST_XWC
      case 0b00010011:  //F2ST_XWC
        F2ST_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F2ST_XWP
      case 0b00010101:  //F2ST_XWP
      case 0b00010110:  //F2ST_XWP
      case 0b00010111:  //F2ST_XWP
        F2ST_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F2ST_XHC
        F2ST.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F2ST_XHCT
        F2ST_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F2ST_XHCG
        F2ST_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F2ST_XHCGT
        F2ST_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F2ST_XHPT
        F2ST_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F2ST_XHPG
        F2ST_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F2ST_XHPGT
        F2ST_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F2ST_A
      case 0b01000001:  //F2ST_A
      case 0b01000010:  //F2ST_A
      case 0b01000011:  //F2ST_A
      case 0b01000100:  //F2ST_A
      case 0b01000101:  //F2ST_A
      case 0b01000110:  //F2ST_A
      case 0b01000111:  //F2ST_A
      case 0b01001000:  //F2ST_A
      case 0b01001001:  //F2ST_A
      case 0b01001010:  //F2ST_A
      case 0b01001011:  //F2ST_A
      case 0b01001100:  //F2ST_A
      case 0b01001101:  //F2ST_A
      case 0b01001110:  //F2ST_A
      case 0b01001111:  //F2ST_A
      case 0b01010000:  //F2ST_A
      case 0b01010001:  //F2ST_A
      case 0b01010010:  //F2ST_A
      case 0b01010011:  //F2ST_A
      case 0b01010100:  //F2ST_A
      case 0b01010101:  //F2ST_A
      case 0b01010110:  //F2ST_A
      case 0b01010111:  //F2ST_A
      case 0b01011000:  //F2ST_A
      case 0b01011001:  //F2ST_A
      case 0b01011010:  //F2ST_A
      case 0b01011011:  //F2ST_A
      case 0b01011100:  //F2ST_A
      case 0b01011101:  //F2ST_A
      case 0b01011110:  //F2ST_A
      case 0b01011111:  //F2ST_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        F2ST.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF2ST);
      }  //switch
    }  //drawRaster
  },  //XF2ST

  //================================================================================
  //F2ST_XWC ($0001,$18xx,$106F)
  //  概要
  //    F2ST  512ドット256色2プレーン＞スプライト＞テキスト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(fpc(f2p())!=0?fpc(f2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=fpc(v0))!=0?v5:ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8):ls1(fpc(tev(v14=f2p())))!=0?fpc(v14):(v16=fpc(v14))!=0?v16:ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19)
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F2ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2ST_XWC

  //================================================================================
  //F2ST_XWP ($0001,$18xx,$146F)
  //  概要
  //    F2ST  512ドット256色2プレーン＞スプライト＞テキスト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?(fpc(tev(f2p()))!=0?fpc(tev(f2p())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):f1p()==1?(fpc(0)!=0?fpc(0):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):f1p()==1?fpc(0)!=0?fpc(0):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:ls4(v5=spp())!=0||(v6=txp())==0?spc(v5):tpc(v6):v0==1?(v9=fpc(0))!=0?v9:ls4(v11=spp())!=0||(v12=txp())==0?spc(v11):tpc(v12):ls1(v0)==0?(v16=fpc(v0))!=0?v16:ls4(v18=spp())!=0||(v19=txp())==0?spc(v18):tpc(v19):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=fpc(0))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p)==0?(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):p==1?(p=fpc(0))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(p&1)==0?(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):p==1?(p=fpc(0))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(p&1)==0?(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):fpo(p&-2)
  F2ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2ST_XWP

  //================================================================================
  //F2ST_XHCT ($0001,$18xx,$196F)
  //  概要
  //    F2ST  512ドット256色2プレーン＞スプライト＞テキスト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラーと
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(fpc(f2p())!=0?fpc(f2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())):fpc(f2p())!=0?fpc(f2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?mix(fpc(v0),ls4(v7=spp())!=0||(v8=txp())==0?spc(v7):tpc(v8)):(v11=fpc(v0))!=0?v11:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):ls1(fpc(tev(v20=f2p())))!=0?mix(fpc(v20),ls4(v24=spp())!=0||(v25=txp())==0?spc(v24):tpc(v25)):(v28=fpc(v20))!=0?v28:ls4(v30=spp())!=0||(v31=txp())==0?spc(v30):tpc(v31)
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)):(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)):(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q))):(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F2ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[q])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (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],
                                    ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[q])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2ST_XHCT

  //================================================================================
  //F2ST_XHCG ($0001,$18xx,$1A6F)
  //  概要
  //    F2ST  512ドット256色2プレーン＞スプライト＞テキスト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが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())):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))):(fpc(f1p())!=0?fpc(f1p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()))))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):(fpc(f2p())!=0?fpc(f2p()):(ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())))))
  //  中間コード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())):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())!=0?fpc(f2p()):ls4(spp())!=0||txp()==0?spc(spp()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(v2=fpc(tev(v0)))!=0?mix(v2,fpc(tod(f2q()))):ls1(v0)!=0?(v9=fpc(tod(f2q())))!=0?v9:ls4(v13=spp())!=0||(v14=txp())==0?spc(v13):tpc(v14):(v17=fpc(v0))!=0?v17:ls4(v19=spp())!=0||(v20=txp())==0?spc(v19):tpc(v20):ls1(v24=fpc(tev(v26=f2p())))!=0?mix(v24,fpc(tod(f2q()))):(v31=fpc(v26))!=0?v31:ls4(v33=spp())!=0||(v34=txp())==0?spc(v33):tpc(v34)
  //  中間コード4
  //    (p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?(p=fpc(tod(f2q())))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):(q=fpc(p))!=0?q:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):(p=fpc(q))!=0?p:ls4(p=spp())!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード5
  //    (p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?(p=fpc(f2q()|1))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):(q=fpc(p))!=0?q:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(p=fpc(q))!=0?p:((p=spp())&15)!=0||(q=txp())==0?spc(p):tpc(q)
  //  中間コード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):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):(q=fpc(p))!=0?cto(q):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(p=fpc(q))!=0?cto(p):((p=spp())&15)!=0||(q=txp())==0?spo(p):tpo(q)
  F2ST_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q] :
                            ((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] :
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q] :
                                ((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] :
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2ST_XHCG

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XSE1T
  //  概要
  //    SE1T  スプライト＞512ドット16色1プレーン＞テキスト
  //    拡張あり
  XSE1T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE1T_XWC
      case 0b00010001:  //SE1T_XWC
      case 0b00010010:  //SE1T_XWC
      case 0b00010011:  //SE1T_XWC
        SE1T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE1T_XWP
      case 0b00010101:  //SE1T_XWP
      case 0b00010110:  //SE1T_XWP
      case 0b00010111:  //SE1T_XWP
        SE1T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE1T_XHC
        SE1T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE1T_XHCT
        SE1T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE1T_XHCG
        SE1T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE1T_XHCGT
        SE1T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE1T_XHPT
        SE1T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE1T_XHPG
        SE1T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE1T_XHPGT
        SE1T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE1T_A
      case 0b01000001:  //SE1T_A
      case 0b01000010:  //SE1T_A
      case 0b01000011:  //SE1T_A
      case 0b01000100:  //SE1T_A
      case 0b01000101:  //SE1T_A
      case 0b01000110:  //SE1T_A
      case 0b01000111:  //SE1T_A
      case 0b01001000:  //SE1T_A
      case 0b01001001:  //SE1T_A
      case 0b01001010:  //SE1T_A
      case 0b01001011:  //SE1T_A
      case 0b01001100:  //SE1T_A
      case 0b01001101:  //SE1T_A
      case 0b01001110:  //SE1T_A
      case 0b01001111:  //SE1T_A
      case 0b01010000:  //SE1T_A
      case 0b01010001:  //SE1T_A
      case 0b01010010:  //SE1T_A
      case 0b01010011:  //SE1T_A
      case 0b01010100:  //SE1T_A
      case 0b01010101:  //SE1T_A
      case 0b01010110:  //SE1T_A
      case 0b01010111:  //SE1T_A
      case 0b01011000:  //SE1T_A
      case 0b01011001:  //SE1T_A
      case 0b01011010:  //SE1T_A
      case 0b01011011:  //SE1T_A
      case 0b01011100:  //SE1T_A
      case 0b01011101:  //SE1T_A
      case 0b01011110:  //SE1T_A
      case 0b01011111:  //SE1T_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        SE1T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE1T);
      }  //switch
    }  //drawRaster
  },  //XSE1T

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

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

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

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

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

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

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

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

  //================================================================================
  //SE2T ($0000,$09xx,$0063)
  //  概要
  //    SE2T  スプライト＞512ドット16色2プレーン＞テキスト
  //    拡張なし
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):epc(e2p()))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):epc(e2p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(e2p())!=0?epc(e2p()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?epc(v4):epc(e2p()):(v8=e1p())!=0?(v9=epc(v8))!=0?v9:tpc(txp()):(v12=epc(e2p()))!=0?v12:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e2p()))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e2p()))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?epo(p):epo(e2p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e2p()))!=0?cto(p):tpo(txp())
  SE2T {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2T

  //================================================================================
  //XSE2T
  //  概要
  //    SE2T  スプライト＞512ドット16色2プレーン＞テキスト
  //    拡張あり
  XSE2T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE2T_XWC
      case 0b00010001:  //SE2T_XWC
      case 0b00010010:  //SE2T_XWC
      case 0b00010011:  //SE2T_XWC
        SE2T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE2T_XWP
      case 0b00010101:  //SE2T_XWP
      case 0b00010110:  //SE2T_XWP
      case 0b00010111:  //SE2T_XWP
        SE2T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE2T_XHC
        SE2T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE2T_XHCT
        SE2T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE2T_XHCG
        SE2T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE2T_XHCGT
        SE2T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE2T_XHPT
        SE2T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE2T_XHPG
        SE2T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE2T_XHPGT
        SE2T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE2T_A
      case 0b01000001:  //SE2T_A
      case 0b01000010:  //SE2T_A
      case 0b01000011:  //SE2T_A
      case 0b01000100:  //SE2T_A
      case 0b01000101:  //SE2T_A
      case 0b01000110:  //SE2T_A
      case 0b01000111:  //SE2T_A
      case 0b01001000:  //SE2T_A
      case 0b01001001:  //SE2T_A
      case 0b01001010:  //SE2T_A
      case 0b01001011:  //SE2T_A
      case 0b01001100:  //SE2T_A
      case 0b01001101:  //SE2T_A
      case 0b01001110:  //SE2T_A
      case 0b01001111:  //SE2T_A
      case 0b01010000:  //SE2T_A
      case 0b01010001:  //SE2T_A
      case 0b01010010:  //SE2T_A
      case 0b01010011:  //SE2T_A
      case 0b01010100:  //SE2T_A
      case 0b01010101:  //SE2T_A
      case 0b01010110:  //SE2T_A
      case 0b01010111:  //SE2T_A
      case 0b01011000:  //SE2T_A
      case 0b01011001:  //SE2T_A
      case 0b01011010:  //SE2T_A
      case 0b01011011:  //SE2T_A
      case 0b01011100:  //SE2T_A
      case 0b01011101:  //SE2T_A
      case 0b01011110:  //SE2T_A
      case 0b01011111:  //SE2T_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        SE2T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE2T);
      }  //switch
    }  //drawRaster
  },  //XSE2T

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XSE3T
  //  概要
  //    SE3T  スプライト＞512ドット16色3プレーン＞テキスト
  //    拡張あり
  XSE3T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE3T_XWC
      case 0b00010001:  //SE3T_XWC
      case 0b00010010:  //SE3T_XWC
      case 0b00010011:  //SE3T_XWC
        SE3T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE3T_XWP
      case 0b00010101:  //SE3T_XWP
      case 0b00010110:  //SE3T_XWP
      case 0b00010111:  //SE3T_XWP
        SE3T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE3T_XHC
        SE3T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE3T_XHCT
        SE3T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE3T_XHCG
        SE3T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE3T_XHCGT
        SE3T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE3T_XHPT
        SE3T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE3T_XHPG
        SE3T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE3T_XHPGT
        SE3T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE3T_A
      case 0b01000001:  //SE3T_A
      case 0b01000010:  //SE3T_A
      case 0b01000011:  //SE3T_A
      case 0b01000100:  //SE3T_A
      case 0b01000101:  //SE3T_A
      case 0b01000110:  //SE3T_A
      case 0b01000111:  //SE3T_A
      case 0b01001000:  //SE3T_A
      case 0b01001001:  //SE3T_A
      case 0b01001010:  //SE3T_A
      case 0b01001011:  //SE3T_A
      case 0b01001100:  //SE3T_A
      case 0b01001101:  //SE3T_A
      case 0b01001110:  //SE3T_A
      case 0b01001111:  //SE3T_A
      case 0b01010000:  //SE3T_A
      case 0b01010001:  //SE3T_A
      case 0b01010010:  //SE3T_A
      case 0b01010011:  //SE3T_A
      case 0b01010100:  //SE3T_A
      case 0b01010101:  //SE3T_A
      case 0b01010110:  //SE3T_A
      case 0b01010111:  //SE3T_A
      case 0b01011000:  //SE3T_A
      case 0b01011001:  //SE3T_A
      case 0b01011010:  //SE3T_A
      case 0b01011011:  //SE3T_A
      case 0b01011100:  //SE3T_A
      case 0b01011101:  //SE3T_A
      case 0b01011110:  //SE3T_A
      case 0b01011111:  //SE3T_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        SE3T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE3T);
      }  //switch
    }  //drawRaster
  },  //XSE3T

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

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

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

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

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

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

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

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

  //================================================================================
  //SE4T ($0000,$09xx,$006F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    拡張なし
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //      さもなくば(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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):(e3p()!=0?epc(e3p()):epc(e4p()))))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):tpc(txp())):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp()))))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):e3p()!=0?epc(e3p()):epc(e4p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?epc(e3p())!=0?epc(e3p()):tpc(txp()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?epc(v4):(v6=e2p())!=0?epc(v6):(v8=e3p())!=0?epc(v8):epc(e4p()):(v12=e1p())!=0?(v13=epc(v12))!=0?v13:tpc(txp()):(v16=e2p())!=0?(v17=epc(v16))!=0?v17:tpc(txp()):(v20=e3p())!=0?(v21=epc(v20))!=0?v21:tpc(txp()):(v24=epc(e4p()))!=0?v24:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):(p=e3p())!=0?epo(p):epo(e4p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()))!=0?cto(p):tpo(txp())
  SE4T {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T

  //================================================================================
  //XSE4T
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    拡張あり
  XSE4T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE4T_XWC
      case 0b00010001:  //SE4T_XWC
      case 0b00010010:  //SE4T_XWC
      case 0b00010011:  //SE4T_XWC
        SE4T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE4T_XWP
      case 0b00010101:  //SE4T_XWP
      case 0b00010110:  //SE4T_XWP
      case 0b00010111:  //SE4T_XWP
        SE4T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE4T_XHC
        SE4T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE4T_XHCT
        SE4T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE4T_XHCG
        SE4T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE4T_XHCGT
        SE4T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE4T_XHPT
        SE4T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE4T_XHPG
        SE4T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE4T_XHPGT
        SE4T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE4T_A
      case 0b01000001:  //SE4T_A
      case 0b01000010:  //SE4T_A
      case 0b01000011:  //SE4T_A
      case 0b01000100:  //SE4T_A
      case 0b01000101:  //SE4T_A
      case 0b01000110:  //SE4T_A
      case 0b01000111:  //SE4T_A
      case 0b01001000:  //SE4T_A
      case 0b01001001:  //SE4T_A
      case 0b01001010:  //SE4T_A
      case 0b01001011:  //SE4T_A
      case 0b01001100:  //SE4T_A
      case 0b01001101:  //SE4T_A
      case 0b01001110:  //SE4T_A
      case 0b01001111:  //SE4T_A
      case 0b01010000:  //SE4T_A
      case 0b01010001:  //SE4T_A
      case 0b01010010:  //SE4T_A
      case 0b01010011:  //SE4T_A
      case 0b01010100:  //SE4T_A
      case 0b01010101:  //SE4T_A
      case 0b01010110:  //SE4T_A
      case 0b01010111:  //SE4T_A
      case 0b01011000:  //SE4T_A
      case 0b01011001:  //SE4T_A
      case 0b01011010:  //SE4T_A
      case 0b01011011:  //SE4T_A
      case 0b01011100:  //SE4T_A
      case 0b01011101:  //SE4T_A
      case 0b01011110:  //SE4T_A
      case 0b01011111:  //SE4T_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        SE4T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE4T);
      }  //switch
    }  //drawRaster
  },  //XSE4T

  //================================================================================
  //SE4T_XWC ($0000,$09xx,$106F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //            スプライトカラーが0でないとき
  //              スプライトカラー
  //            さもなくば(スプライトカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                4番目のカラー(0は黒)
  //            さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                テキストカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):tpc(txp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e3p())):(epc(e3p())!=0?epc(e3p()):tpc(txp())))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e4p())):(epc(e4p())!=0?epc(e4p()):tpc(txp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e3p()):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?epc(e4p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e4p()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):ls4(v6=spp())!=0||v6!=0&&txp()==0?(v8=spc(v6))!=0?v8:epc(v0):(v10=epc(v0))!=0?v10:tpc(txp()):(v13=e2p())!=0?ls1(epc(tev(v13)))!=0?epc(v13):ls4(v19=spp())!=0||v19!=0&&txp()==0?(v21=spc(v19))!=0?v21:epc(v13):(v23=epc(v13))!=0?v23:tpc(txp()):(v26=e3p())!=0?ls1(epc(tev(v26)))!=0?epc(v26):ls4(v32=spp())!=0||v32!=0&&txp()==0?(v34=spc(v32))!=0?v34:epc(v26):(v36=epc(v26))!=0?v36:tpc(txp()):ls1(epc(tev(v42=e4p())))!=0?epc(v42):ls4(v45=spp())!=0||v45!=0&&txp()==0?(v47=spc(v45))!=0?v47:epc(v42):(v49=epc(v42))!=0?v49:tpc(txp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e4p())))!=0?epc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e4p())&-2)&1)!=0?epc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e4p())&-2)&1)!=0?epo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp())
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XWC

  //================================================================================
  //SE4T_XWP ($0000,$09xx,$146F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが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のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p()))))):((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()))))):e1p()==1?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(0)):(epc(0)!=0?epc(0):tpc(txp()))):ls1(e1p())==0?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(0):epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(txp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?ls4(v2=spp())!=0||v2!=0&&txp()==0?(v4=spc(v2))!=0?v4:(v5=tev(e2p()))!=0?epc(v5):(v8=tev(e3p()))!=0?epc(v8):epc(tev(e4p())):(v14=tev(e2p()))!=0?(v16=epc(v14))!=0?v16:tpc(txp()):(v19=tev(e3p()))!=0?(v21=epc(v19))!=0?v21:tpc(txp()):(v24=epc(tev(e4p())))!=0?v24:tpc(txp()):v0==1?ls4(v30=spp())!=0||v30!=0&&txp()==0?(v32=spc(v30))!=0?v32:epc(0):(v34=epc(0))!=0?v34:tpc(txp()):ls1(v0)==0?ls4(v39=spp())!=0||v39!=0&&txp()==0?(v41=spc(v39))!=0?v41:epc(v0):(v43=epc(v0))!=0?v43:tpc(txp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(txp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(txp()):epo(p&-2)
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XWP

  //================================================================================
  //SE4T_XHCT ($0000,$09xx,$196F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp()))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp())))))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(txp())):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(txp())):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(txp())):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?ls1(epc(tev(v4)))!=0?mix(epc(v4),0):epc(v4):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?mix(epc(v11),0):epc(v11):(v18=e3p())!=0?ls1(epc(tev(v18)))!=0?mix(epc(v18),0):epc(v18):ls1(epc(tev(v28=e4p())))!=0?mix(epc(v28),0):epc(v28):(v32=e1p())!=0?ls1(epc(tev(v32)))!=0?mix(epc(v32),tpc(txp())):(v40=epc(v32))!=0?v40:tpc(txp()):(v43=e2p())!=0?ls1(epc(tev(v43)))!=0?mix(epc(v43),tpc(txp())):(v51=epc(v43))!=0?v51:tpc(txp()):(v54=e3p())!=0?ls1(epc(tev(v54)))!=0?mix(epc(v54),tpc(txp())):(v62=epc(v54))!=0?v62:tpc(txp()):ls1(epc(tev(v68=e4p())))!=0?mix(epc(v68),tpc(txp())):(v73=epc(v68))!=0?v73:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),tpc(txp())):(q=epc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp())
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XHCT

  //================================================================================
  //SE4T_XHCG ($0000,$09xx,$1A6F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp())))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp()))))))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?ls1(v6=epc(tev(v4)))!=0?mix(v6,epc(tod(e2q()))):ls1(v4)!=0?epc(tod(e2q())):epc(v4):(v17=e2p())!=0?ls1(v19=epc(tev(v17)))!=0?mix(v19,epc(tod(e2q()))):epc(v17):(v26=e3p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(v28,epc(1)):ls1(v26)!=0?epc(1):epc(v26):ls1(v36=epc(tev(v38=e4p())))!=0?mix(v36,epc(1)):ls1(v38)!=0?epc(1):epc(v38):(v44=e1p())!=0?ls1(v46=epc(tev(v44)))!=0?mix(v46,epc(tod(e2q()))):ls1(v44)!=0?(v53=epc(tod(e2q())))!=0?v53:tpc(txp()):(v58=epc(v44))!=0?v58:tpc(txp()):(v61=e2p())!=0?ls1(v63=epc(tev(v61)))!=0?mix(v63,epc(tod(e2q()))):(v69=epc(v61))!=0?v69:tpc(txp()):(v72=e3p())!=0?ls1(v74=epc(tev(v72)))!=0?mix(v74,epc(1)):ls1(v72)!=0?(v79=epc(1))!=0?v79:tpc(txp()):(v82=epc(v72))!=0?v82:tpc(txp()):ls1(v86=epc(tev(v88=e4p())))!=0?mix(v86,epc(1)):ls1(v88)!=0?(v92=epc(1))!=0?v92:tpc(txp()):(v95=epc(v88))!=0?v95:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(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):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28] :
                            (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[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15] :
                                (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[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XHCG

  //================================================================================
  //SE4T_XHCGT ($0000,$09xx,$1B6F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp())):(epc(e1p())!=0?epc(e1p()):tpc(txp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):(epc(e2p())!=0?epc(e2p()):tpc(txp()))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(txp())):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e3p())!=0?epc(e3p()):tpc(txp())))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(txp())):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(txp())):(epc(e4p())!=0?epc(e4p()):tpc(txp()))))))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(txp()):epc(e1p())!=0?epc(e1p()):tpc(txp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(txp())):epc(e2p())!=0?epc(e2p()):tpc(txp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(txp())):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e3p())!=0?epc(e3p()):tpc(txp()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(txp())):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(txp()):epc(e4p())!=0?epc(e4p()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?ls1(v6=epc(tev(v4)))!=0?mix(mix(v6,epc(tod(e2q()))),0):ls1(v4)!=0?epc(tod(e2q())):epc(v4):(v18=e2p())!=0?ls1(v20=epc(tev(v18)))!=0?mix(mix(v20,epc(tod(e2q()))),0):epc(v18):(v28=e3p())!=0?ls1(v30=epc(tev(v28)))!=0?mix(mix(v30,epc(1)),0):ls1(v28)!=0?epc(1):epc(v28):ls1(v39=epc(tev(v41=e4p())))!=0?mix(mix(v39,epc(1)),0):ls1(v41)!=0?epc(1):epc(v41):(v48=e1p())!=0?ls1(v50=epc(tev(v48)))!=0?mix(mix(v50,epc(tod(e2q()))),tpc(txp())):ls1(v48)!=0?(v60=epc(tod(e2q())))!=0?v60:tpc(txp()):(v65=epc(v48))!=0?v65:tpc(txp()):(v68=e2p())!=0?ls1(v70=epc(tev(v68)))!=0?mix(mix(v70,epc(tod(e2q()))),tpc(txp())):(v79=epc(v68))!=0?v79:tpc(txp()):(v82=e3p())!=0?ls1(v84=epc(tev(v82)))!=0?mix(mix(v84,epc(1)),tpc(txp())):ls1(v82)!=0?(v92=epc(1))!=0?v92:tpc(txp()):(v95=epc(v82))!=0?v95:tpc(txp()):ls1(v99=epc(tev(v101=e4p())))!=0?mix(mix(v99,epc(1)),tpc(txp())):ls1(v101)!=0?(v108=epc(1))!=0?v108:tpc(txp()):(v111=epc(v101))!=0?v111:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(txp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),tpc(txp())):ls1(p)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),tpc(txp())):ls1(q)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(txp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(txp())):(q=epc(p))!=0?q:tpc(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),tpc(txp())):(p&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(q=epc(p))!=0?q:tpc(txp()):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),tpc(txp())):(q&1)!=0?(p=epc(1))!=0?p:tpc(txp()):(p=epc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(txp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(txp()))):(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),tpc(txp()))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(q=epc(p))!=0?cto(q):tpo(txp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),tpc(txp()))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(txp()):(p=epc(q))!=0?cto(p):tpo(txp())
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (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[tp >>> 28])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[tp >>> 28])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (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[tp >>> 24 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                ((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[tp >>> 24 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (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[tp >>> 20 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                ((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[tp >>> 20 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (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[tp >>> 16 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                ((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[tp >>> 16 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (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[tp >>> 12 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                ((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[tp >>> 12 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (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[tp >>> 8 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                ((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[tp >>> 8 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (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[tp >>> 4 & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                ((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[tp >>> 4 & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (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[tp & 15])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                ((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[tp & 15])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XHCGT

  //================================================================================
  //SE4T_XHPT ($0000,$09xx,$1D6F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))):(e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp())))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(epc(tev(e1p())),tpc(txp()))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0):e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),tpc(txp()))
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())==0?(v5=tev(e2p()))!=0?epc(v5):(v8=tev(e3p()))!=0?epc(v8):epc(tev(e4p())):v4==1?epc(0):ls1(v4)==0?epc(v4):mix(epc(tev(v4)),0):(v20=e1p())==0?(v21=tev(e2p()))!=0?(v23=epc(v21))!=0?v23:tpc(txp()):(v26=tev(e3p()))!=0?(v28=epc(v26))!=0?v28:tpc(txp()):(v31=epc(tev(e4p())))!=0?v31:tpc(txp()):v20==1?(v36=epc(0))!=0?v36:tpc(txp()):ls1(v20)==0?(v40=epc(v20))!=0?v40:tpc(txp()):mix(epc(tev(v20)),tpc(txp()))
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0):(p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(tev(p)),tpc(txp()))
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(epc(p&-2),tpc(txp()))
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0)):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(epc(p&-2),tpc(txp())))
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (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[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (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[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[tp & 15])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XHPT

  //================================================================================
  //SE4T_XHPG ($0000,$09xx,$1E6F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp())))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp()))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())==0?(v5=tev(e2p()))!=0?epc(v5):(v8=tev(e3p()))!=0?epc(v8):epc(tev(e4p())):v4==1?epc(0):ls1(v4)==0?epc(v4):mix(epc(tev(v4)),epc(tod(e2q()))):(v23=e1p())==0?(v24=tev(e2p()))!=0?(v26=epc(v24))!=0?v26:tpc(txp()):(v29=tev(e3p()))!=0?(v31=epc(v29))!=0?v31:tpc(txp()):(v34=epc(tev(e4p())))!=0?v34:tpc(txp()):v23==1?(v39=epc(0))!=0?v39:tpc(txp()):ls1(v23)==0?(v43=epc(v23))!=0?v43:tpc(txp()):(v46=mix(epc(tev(v23)),epc(tod(e2q()))))!=0?v46:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(txp())
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XHPG

  //================================================================================
  //SE4T_XHPGT ($0000,$09xx,$1F6F)
  //  概要
  //    SE4T  スプライト＞512ドット16色4プレーン＞テキスト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0))):(e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp())):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp())):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp())))):e1p()==1?(epc(0)!=0?epc(0):tpc(txp())):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(txp())):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp()))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(txp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(txp()):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(txp()):e1p()==1?epc(0)!=0?epc(0):tpc(txp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(txp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(txp()))
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:(v4=e1p())==0?(v5=tev(e2p()))!=0?epc(v5):(v8=tev(e3p()))!=0?epc(v8):epc(tev(e4p())):v4==1?epc(0):ls1(v4)==0?epc(v4):mix(mix(epc(tev(v4)),epc(tod(e2q()))),0):(v24=e1p())==0?(v25=tev(e2p()))!=0?(v27=epc(v25))!=0?v27:tpc(txp()):(v30=tev(e3p()))!=0?(v32=epc(v30))!=0?v32:tpc(txp()):(v35=epc(tev(e4p())))!=0?v35:tpc(txp()):v24==1?(v40=epc(0))!=0?v40:tpc(txp()):ls1(v24)==0?(v44=epc(v24))!=0?v44:tpc(txp()):mix(mix(epc(tev(v24)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0):(p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(tev(e4p())))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):ls1(p)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(txp()))
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(txp()):(p=epc(e4p()&-2))!=0?p:tpc(txp()):p==1?(p=epc(0))!=0?p:tpc(txp()):(p&1)==0?(q=epc(p))!=0?q:tpc(txp()):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp()))
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0)):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(txp()):(p=epc(e4p()&-2))!=0?cto(p):tpo(txp()):p==1?(p=epc(0))!=0?cto(p):tpo(txp()):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(txp()):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(txp())))
  SE4T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (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[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (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[tp >>> 28] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[tp >>> 28])]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 24 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 24 & 15])]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 20 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 20 & 15])]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 16 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 16 & 15])]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 12 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 12 & 15])]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 8 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 8 & 15])]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (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[tp >>> 4 & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp >>> 4 & 15])]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (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[tp & 15] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[tp & 15])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4T_XHPGT

  //================================================================================
  //SF1T ($0001,$09xx,$0063)
  //  概要
  //    SF1T  スプライト＞512ドット256色1プレーン＞テキスト
  //    拡張なし
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストカラー(0は黒)
  //  中間コード1
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp())))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:fpc(f1p()):(v6=fpc(f1p()))!=0?v6:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):fpo(f1p()):(p=fpc(f1p()))!=0?cto(p):tpo(txp())
  SF1T {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1T

  //================================================================================
  //XSF1T
  //  概要
  //    SF1T  スプライト＞512ドット256色1プレーン＞テキスト
  //    拡張あり
  XSF1T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SF1T_XWC
      case 0b00010001:  //SF1T_XWC
      case 0b00010010:  //SF1T_XWC
      case 0b00010011:  //SF1T_XWC
        SF1T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SF1T_XWP
      case 0b00010101:  //SF1T_XWP
      case 0b00010110:  //SF1T_XWP
      case 0b00010111:  //SF1T_XWP
        SF1T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SF1T_XHC
        SF1T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SF1T_XHCT
        SF1T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SF1T_XHCG
        SF1T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SF1T_XHCGT
        SF1T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SF1T_XHPT
        SF1T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SF1T_XHPG
        SF1T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SF1T_XHPGT
        SF1T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SF1T_A
      case 0b01000001:  //SF1T_A
      case 0b01000010:  //SF1T_A
      case 0b01000011:  //SF1T_A
      case 0b01000100:  //SF1T_A
      case 0b01000101:  //SF1T_A
      case 0b01000110:  //SF1T_A
      case 0b01000111:  //SF1T_A
      case 0b01001000:  //SF1T_A
      case 0b01001001:  //SF1T_A
      case 0b01001010:  //SF1T_A
      case 0b01001011:  //SF1T_A
      case 0b01001100:  //SF1T_A
      case 0b01001101:  //SF1T_A
      case 0b01001110:  //SF1T_A
      case 0b01001111:  //SF1T_A
      case 0b01010000:  //SF1T_A
      case 0b01010001:  //SF1T_A
      case 0b01010010:  //SF1T_A
      case 0b01010011:  //SF1T_A
      case 0b01010100:  //SF1T_A
      case 0b01010101:  //SF1T_A
      case 0b01010110:  //SF1T_A
      case 0b01010111:  //SF1T_A
      case 0b01011000:  //SF1T_A
      case 0b01011001:  //SF1T_A
      case 0b01011010:  //SF1T_A
      case 0b01011011:  //SF1T_A
      case 0b01011100:  //SF1T_A
      case 0b01011101:  //SF1T_A
      case 0b01011110:  //SF1T_A
      case 0b01011111:  //SF1T_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        SF1T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSF1T);
      }  //switch
    }  //drawRaster
  },  //XSF1T

  //================================================================================
  //SF1T_XWC ($0001,$09xx,$1063)
  //  概要
  //    SF1T  スプライト＞512ドット256色1プレーン＞テキスト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):ls4(v6=spp())!=0||v6!=0&&txp()==0?(v8=spc(v6))!=0?v8:fpc(v3):(v10=fpc(v3))!=0?v10:tpc(txp())
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp())
  SF1T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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 = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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 = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1T_XWC

  //================================================================================
  //SF1T_XWP ($0001,$09xx,$1463)
  //  概要
  //    SF1T  スプライト＞512ドット256色1プレーン＞テキスト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(0)):(fpc(0)!=0?fpc(0):tpc(txp()))):ls1(f1p())==0?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(0):fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(txp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?ls4(v2=spp())!=0||v2!=0&&txp()==0?(v4=spc(v2))!=0?v4:fpc(0):(v6=fpc(0))!=0?v6:tpc(txp()):ls1(v0)==0?ls4(v11=spp())!=0||v11!=0&&txp()==0?(v13=spc(v11))!=0?v13:fpc(v0):(v15=fpc(v0))!=0?v15:tpc(txp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):fpo(0):(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp()):fpo(p&-2)
  SF1T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1T_XWP

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

  //================================================================================
  //SF1T_XHCG ($0001,$09xx,$1A63)
  //  概要
  //    SF1T  スプライト＞512ドット256色1プレーン＞テキスト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが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
  //    (ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(txp())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp())))))
  //  中間コード2
  //    ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(txp()):fpc(f1p())!=0?fpc(f1p()):tpc(txp())
  //  中間コード3
  //    ls4(v1=spp())!=0||v1!=0&&txp()==0?(v3=spc(v1))!=0?v3:ls1(v5=fpc(tev(v7=f1p())))!=0?mix(v5,fpc(tod(f2q()))):ls1(v7)!=0?fpc(tod(f2q())):fpc(v7):ls1(v18=fpc(tev(v20=f1p())))!=0?mix(v18,fpc(tod(f2q()))):ls1(v20)!=0?(v26=fpc(tod(f2q())))!=0?v26:tpc(txp()):(v31=fpc(v20))!=0?v31:tpc(txp())
  //  中間コード4
  //    ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?fpc(tod(f2q())):fpc(q):ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(txp()):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード5
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?fpc(f2q()|1):fpc(q):((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(txp()):(p=fpc(q))!=0?p:tpc(txp())
  //  中間コード6
  //    ((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?fpo(f2q()|1):fpo(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(txp()):(p=fpc(q))!=0?cto(p):tpo(txp())
  SF1T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[tp >>> 28] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 24 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 20 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 16 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 12 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 8 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp >>> 4 & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[tp & 15] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1T_XHCG

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

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

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

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

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

  //================================================================================
  //XSF2T
  //  概要
  //    SF2T  スプライト＞512ドット256色2プレーン＞テキスト
  //    拡張あり
  XSF2T {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SF2T_XWC
      case 0b00010001:  //SF2T_XWC
      case 0b00010010:  //SF2T_XWC
      case 0b00010011:  //SF2T_XWC
        SF2T_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SF2T_XWP
      case 0b00010101:  //SF2T_XWP
      case 0b00010110:  //SF2T_XWP
      case 0b00010111:  //SF2T_XWP
        SF2T_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SF2T_XHC
        SF2T.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SF2T_XHCT
        SF2T_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SF2T_XHCG
        SF2T_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SF2T_XHCGT
        SF2T_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SF2T_XHPT
        SF2T_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SF2T_XHPG
        SF2T_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SF2T_XHPGT
        SF2T_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SF2T_A
      case 0b01000001:  //SF2T_A
      case 0b01000010:  //SF2T_A
      case 0b01000011:  //SF2T_A
      case 0b01000100:  //SF2T_A
      case 0b01000101:  //SF2T_A
      case 0b01000110:  //SF2T_A
      case 0b01000111:  //SF2T_A
      case 0b01001000:  //SF2T_A
      case 0b01001001:  //SF2T_A
      case 0b01001010:  //SF2T_A
      case 0b01001011:  //SF2T_A
      case 0b01001100:  //SF2T_A
      case 0b01001101:  //SF2T_A
      case 0b01001110:  //SF2T_A
      case 0b01001111:  //SF2T_A
      case 0b01010000:  //SF2T_A
      case 0b01010001:  //SF2T_A
      case 0b01010010:  //SF2T_A
      case 0b01010011:  //SF2T_A
      case 0b01010100:  //SF2T_A
      case 0b01010101:  //SF2T_A
      case 0b01010110:  //SF2T_A
      case 0b01010111:  //SF2T_A
      case 0b01011000:  //SF2T_A
      case 0b01011001:  //SF2T_A
      case 0b01011010:  //SF2T_A
      case 0b01011011:  //SF2T_A
      case 0b01011100:  //SF2T_A
      case 0b01011101:  //SF2T_A
      case 0b01011110:  //SF2T_A
      case 0b01011111:  //SF2T_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        SF2T.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSF2T);
      }  //switch
    }  //drawRaster
  },  //XSF2T

  //================================================================================
  //SF2T_XWC ($0001,$09xx,$106F)
  //  概要
  //    SF2T  スプライト＞512ドット256色2プレーン＞テキスト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp())))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(f2p())):(fpc(f2p())!=0?fpc(f2p()):tpc(txp())))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(txp()):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):tpc(txp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):ls4(v6=spp())!=0||v6!=0&&txp()==0?(v8=spc(v6))!=0?v8:fpc(v0):(v10=fpc(v0))!=0?v10:tpc(txp()):ls1(fpc(tev(v16=f2p())))!=0?fpc(v16):ls4(v19=spp())!=0||v19!=0&&txp()==0?(v21=spc(v19))!=0?v21:fpc(v16):(v23=fpc(v16))!=0?v23:tpc(txp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp()):ls1(fpc(tev(p=f2p())))!=0?fpc(p):ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp()):(fpc((p=f2p())&-2)&1)!=0?fpc(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp())
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp()):(fpc((p=f2p())&-2)&1)!=0?fpo(p):((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp())
  SF2T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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 = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28]);
          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 = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15]);
          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 = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF2T_XWC

  //================================================================================
  //SF2T_XWP ($0001,$09xx,$146F)
  //  概要
  //    SF2T  スプライト＞512ドット256色2プレーン＞テキスト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが1のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットの下位4bitが0でないまたは(スプライトパレットが0でないかつテキストパレットが0)のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0または(スプライトパレットの下位4bitが0かつテキストパレットが0でない)のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(tev(f2p()))):(fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(txp()))):f1p()==1?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(0)):(fpc(0)!=0?fpc(0):tpc(txp()))):ls1(f1p())==0?(ls4(spp())!=0||(spp()!=0&&txp()==0)?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(txp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(tev(f2p())):fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(txp()):f1p()==1?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(0):fpc(0)!=0?fpc(0):tpc(txp()):ls1(f1p())==0?ls4(spp())!=0||spp()!=0&&txp()==0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(txp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?ls4(v2=spp())!=0||v2!=0&&txp()==0?(v4=spc(v2))!=0?v4:fpc(tev(f2p())):(v8=fpc(tev(f2p())))!=0?v8:tpc(txp()):v0==1?ls4(v14=spp())!=0||v14!=0&&txp()==0?(v16=spc(v14))!=0?v16:fpc(0):(v18=fpc(0))!=0?v18:tpc(txp()):ls1(v0)==0?ls4(v23=spp())!=0||v23!=0&&txp()==0?(v25=spc(v23))!=0?v25:fpc(v0):(v27=fpc(v0))!=0?v27:tpc(txp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(tev(f2p())):(p=fpc(tev(f2p())))!=0?p:tpc(txp()):p==1?ls4(p=spp())!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(txp()):ls1(p)==0?ls4(q=spp())!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(f2p()&-2):(p=fpc(f2p()&-2))!=0?p:tpc(txp()):p==1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(txp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):fpo(f2p()&-2):(p=fpc(f2p()&-2))!=0?cto(p):tpo(txp()):p==1?((p=spp())&15)!=0||p!=0&&txp()==0?(q=spc(p))!=0?cto(q):fpo(0):(p=fpc(0))!=0?cto(p):tpo(txp()):(p&1)==0?((q=spp())&15)!=0||q!=0&&txp()==0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(txp()):fpo(p&-2)
  SF2T_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            p == 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || p != 0 && tp >>> 28 == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || q != 0 && tp >>> 28 == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[tp >>> 28] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || p != 0 && (tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || q != 0 && (tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 24 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || p != 0 && (tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || q != 0 && (tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 20 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || p != 0 && (tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || q != 0 && (tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 16 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || p != 0 && (tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || q != 0 && (tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 12 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || p != 0 && (tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || q != 0 && (tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 8 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || p != 0 && (tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || q != 0 && (tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp >>> 4 & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || p != 0 && (tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[tp & 15] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || q != 0 && (tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[tp & 15] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF2T_XWP

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //SE1t ($0000,$09xx,$0041)
  //  概要
  //    SE1t  スプライト＞512ドット16色1プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(0)))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:epc(e1p()):(v4=epc(e1p()))!=0?v4:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:epc(e1p()):(p=epc(e1p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:epc(e1p()):(p=epc(e1p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):epo(e1p()):(p=epc(e1p()))!=0?cto(p):tpo(0)
  SE1t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE1t

  //================================================================================
  //XSE1t
  //  概要
  //    SE1t  スプライト＞512ドット16色1プレーン＞テキスト(OFF)
  //    拡張あり
  XSE1t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE1t_XWC
      case 0b00010001:  //SE1t_XWC
      case 0b00010010:  //SE1t_XWC
      case 0b00010011:  //SE1t_XWC
        SE1t_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE1t_XWP
      case 0b00010101:  //SE1t_XWP
      case 0b00010110:  //SE1t_XWP
      case 0b00010111:  //SE1t_XWP
        SE1t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE1t_XHC
        SE1t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE1t_XHCT
        SE1t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE1t_XHCG
        SE1t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE1t_XHCGT
        SE1t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE1t_XHPT
        SE1t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE1t_XHPG
        SE1t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE1t_XHPGT
        SE1t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE1t_A
      case 0b01000001:  //SE1t_A
      case 0b01000010:  //SE1t_A
      case 0b01000011:  //SE1t_A
      case 0b01000100:  //SE1t_A
      case 0b01000101:  //SE1t_A
      case 0b01000110:  //SE1t_A
      case 0b01000111:  //SE1t_A
      case 0b01001000:  //SE1t_A
      case 0b01001001:  //SE1t_A
      case 0b01001010:  //SE1t_A
      case 0b01001011:  //SE1t_A
      case 0b01001100:  //SE1t_A
      case 0b01001101:  //SE1t_A
      case 0b01001110:  //SE1t_A
      case 0b01001111:  //SE1t_A
      case 0b01010000:  //SE1t_A
      case 0b01010001:  //SE1t_A
      case 0b01010010:  //SE1t_A
      case 0b01010011:  //SE1t_A
      case 0b01010100:  //SE1t_A
      case 0b01010101:  //SE1t_A
      case 0b01010110:  //SE1t_A
      case 0b01010111:  //SE1t_A
      case 0b01011000:  //SE1t_A
      case 0b01011001:  //SE1t_A
      case 0b01011010:  //SE1t_A
      case 0b01011011:  //SE1t_A
      case 0b01011100:  //SE1t_A
      case 0b01011101:  //SE1t_A
      case 0b01011110:  //SE1t_A
      case 0b01011111:  //SE1t_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        SE1t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE1t);
      }  //switch
    }  //drawRaster
  },  //XSE1t

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

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

  //================================================================================
  //SE1t_XHCT ($0000,$09xx,$1941)
  //  概要
  //    SE1t  スプライト＞512ドット16色1プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()))):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:ls1(epc(tev(v5=e1p())))!=0?mix(epc(v5),0):epc(v5):ls1(epc(tev(v12=e1p())))!=0?mix(epc(v12),tpc(0)):(v16=epc(v12))!=0?v16:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:ls1(epc(tev(p=e1p())))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e1p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(epc((p=e1p())&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e1p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  SE1t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE1t_XHCT

  //================================================================================
  //SE1t_XHCG ($0000,$09xx,$1A41)
  //  概要
  //    SE1t  スプライト＞512ドット16色1プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())))):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:ls1(v3=epc(tev(v5=e1p())))!=0?mix(v3,epc(tod(e2q()))):ls1(v5)!=0?epc(tod(e2q())):epc(v5):ls1(v16=epc(tev(v18=e1p())))!=0?mix(v16,epc(tod(e2q()))):ls1(v18)!=0?(v24=epc(tod(e2q())))!=0?v24:tpc(0):(v28=epc(v18))!=0?v28:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?epc(tod(e2q())):epc(q):ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?epc(e2q()|1):epc(q):((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?epo(e2q()|1):epo(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  SE1t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE1t_XHCG

  //================================================================================
  //SE1t_XHCGT ($0000,$09xx,$1B41)
  //  概要
  //    SE1t  スプライト＞512ドット16色1プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())))):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:ls1(v3=epc(tev(v5=e1p())))!=0?mix(mix(v3,epc(tod(e2q()))),0):ls1(v5)!=0?epc(tod(e2q())):epc(v5):ls1(v17=epc(tev(v19=e1p())))!=0?mix(mix(v17,epc(tod(e2q()))),tpc(0)):ls1(v19)!=0?(v27=epc(tod(e2q())))!=0?v27:tpc(0):(v31=epc(v19))!=0?v31:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),0):ls1(q)!=0?epc(tod(e2q())):epc(q):ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),tpc(0)):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):(q&1)!=0?epc(e2q()|1):epc(q):((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),tpc(0)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):(q&1)!=0?epo(e2q()|1):epo(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),tpc(0))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  SE1t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE1t_XHCGT

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

  //================================================================================
  //SE1t_XHPG ($0000,$09xx,$1E41)
  //  概要
  //    SE1t  スプライト＞512ドット16色1プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(e1p()<=1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):e1p()<=1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q()))):(v12=e1p())<=1?(v13=epc(0))!=0?v13:tpc(0):ls1(v12)==0?(v16=epc(v12))!=0?v16:tpc(0):(v18=mix(epc(tev(v12)),epc(tod(e2q()))))!=0?v18:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(0)
  SE1t_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE1t_XHPG

  //================================================================================
  //SE1t_XHPGT ($0000,$09xx,$1F41)
  //  概要
  //    SE1t  スプライト＞512ドット16色1プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0))):(e1p()<=1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):e1p()<=1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0))
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0):(v13=e1p())<=1?(v14=epc(0))!=0?v14:tpc(0):ls1(v13)==0?(v17=epc(v13))!=0?v17:tpc(0):mix(mix(epc(tev(v13)),epc(tod(e2q()))),tpc(0))
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(0))
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0):(p=e1p())<=1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0))
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0)):(p=e1p())<=1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0)))
  SE1t_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE1t_XHPGT

  //================================================================================
  //SE2t ($0000,$09xx,$0043)
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):epc(e2p()))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):epc(e2p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(0):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):epc(e2p()):(v6=e1p())!=0?(v7=epc(v6))!=0?v7:tpc(0):(v9=epc(e2p()))!=0?v9:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e2p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e2p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?epo(p):epo(e2p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e2p()))!=0?cto(p):tpo(0)
  SE2t {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2t

  //================================================================================
  //XSE2t
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    拡張あり
  XSE2t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE2t_XWC
      case 0b00010001:  //SE2t_XWC
      case 0b00010010:  //SE2t_XWC
      case 0b00010011:  //SE2t_XWC
        SE2t_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE2t_XWP
      case 0b00010101:  //SE2t_XWP
      case 0b00010110:  //SE2t_XWP
      case 0b00010111:  //SE2t_XWP
        SE2t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE2t_XHC
        SE2t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE2t_XHCT
        SE2t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE2t_XHCG
        SE2t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE2t_XHCGT
        SE2t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE2t_XHPT
        SE2t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE2t_XHPG
        SE2t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE2t_XHPGT
        SE2t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE2t_A
      case 0b01000001:  //SE2t_A
      case 0b01000010:  //SE2t_A
      case 0b01000011:  //SE2t_A
      case 0b01000100:  //SE2t_A
      case 0b01000101:  //SE2t_A
      case 0b01000110:  //SE2t_A
      case 0b01000111:  //SE2t_A
      case 0b01001000:  //SE2t_A
      case 0b01001001:  //SE2t_A
      case 0b01001010:  //SE2t_A
      case 0b01001011:  //SE2t_A
      case 0b01001100:  //SE2t_A
      case 0b01001101:  //SE2t_A
      case 0b01001110:  //SE2t_A
      case 0b01001111:  //SE2t_A
      case 0b01010000:  //SE2t_A
      case 0b01010001:  //SE2t_A
      case 0b01010010:  //SE2t_A
      case 0b01010011:  //SE2t_A
      case 0b01010100:  //SE2t_A
      case 0b01010101:  //SE2t_A
      case 0b01010110:  //SE2t_A
      case 0b01010111:  //SE2t_A
      case 0b01011000:  //SE2t_A
      case 0b01011001:  //SE2t_A
      case 0b01011010:  //SE2t_A
      case 0b01011011:  //SE2t_A
      case 0b01011100:  //SE2t_A
      case 0b01011101:  //SE2t_A
      case 0b01011110:  //SE2t_A
      case 0b01011111:  //SE2t_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        SE2t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE2t);
      }  //switch
    }  //drawRaster
  },  //XSE2t

  //================================================================================
  //SE2t_XWC ($0000,$09xx,$1043)
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットが0でないとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットが0でないとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):tpc(0)))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(0):ls1(epc(tev(e2p())))!=0?epc(e2p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=spp())!=0?(v6=spc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:tpc(0):ls1(epc(tev(v13=e2p())))!=0?epc(v13):(v15=spp())!=0?(v16=spc(v15))!=0?v16:epc(v13):(v18=epc(v13))!=0?v18:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e2p())))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(epc((p=e2p())&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0)
  SE2t_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2t_XWC

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

  //================================================================================
  //SE2t_XHCT ($0000,$09xx,$1943)
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):ls1(epc(tev(v12=e2p())))!=0?mix(epc(v12),0):epc(v12):(v16=e1p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),tpc(0)):(v23=epc(v16))!=0?v23:tpc(0):ls1(epc(tev(v28=e2p())))!=0?mix(epc(v28),tpc(0)):(v32=epc(v28))!=0?v32:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  SE2t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2t_XHCT

  //================================================================================
  //SE2t_XHCG ($0000,$09xx,$1A43)
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v16=epc(tev(v18=e2p())))!=0?mix(v16,epc(tod(e2q()))):epc(v18):(v24=e1p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(tod(e2q()))):ls1(v24)!=0?(v33=epc(tod(e2q())))!=0?v33:tpc(0):(v37=epc(v24))!=0?v37:tpc(0):ls1(v40=epc(tev(v42=e2p())))!=0?mix(v40,epc(tod(e2q()))):(v47=epc(v42))!=0?v47:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):epo(q):(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):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(p=epc(q))!=0?cto(p):tpo(0)
  SE2t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2t_XHCG

  //================================================================================
  //SE2t_XHCGT ($0000,$09xx,$1B43)
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v17=epc(tev(v19=e2p())))!=0?mix(mix(v17,epc(tod(e2q()))),0):epc(v19):(v26=e1p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(tod(e2q()))),tpc(0)):ls1(v26)!=0?(v37=epc(tod(e2q())))!=0?v37:tpc(0):(v41=epc(v26))!=0?v41:tpc(0):ls1(v44=epc(tev(v46=e2p())))!=0?mix(mix(v44,epc(tod(e2q()))),tpc(0)):(v53=epc(v46))!=0?v53:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),0):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),tpc(0)):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),tpc(0)):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):epo(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),tpc(0))):(p=epc(q))!=0?cto(p):tpo(0)
  SE2t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2t_XHCGT

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

  //================================================================================
  //SE2t_XHPG ($0000,$09xx,$1E43)
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))))):(e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))):e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2p()))):(v15=e1p())==0?(v16=epc(tev(e2p())))!=0?v16:tpc(0):v15==1?(v20=epc(0))!=0?v20:tpc(0):ls1(v15)==0?(v23=epc(v15))!=0?v23:tpc(0):(v25=mix(epc(tev(v15)),epc(tod(e2p()))))!=0?v25:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p()))):(p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(tev(p)),epc(tod(e2p()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1)):(p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1))):(p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?cto(q):tpo(0)
  SE2t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2t_XHPG

  //================================================================================
  //SE2t_XHPGT ($0000,$09xx,$1F43)
  //  概要
  //    SE2t  スプライト＞512ドット16色2プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0))):(e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0):e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),tpc(0))
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2p()))),0):(v16=e1p())==0?(v17=epc(tev(e2p())))!=0?v17:tpc(0):v16==1?(v21=epc(0))!=0?v21:tpc(0):ls1(v16)==0?(v24=epc(v16))!=0?v24:tpc(0):mix(mix(epc(tev(v16)),epc(tod(e2p()))),tpc(0))
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2p()))),0):(p=e1p())==0?(p=epc(tev(e2p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(tev(p)),epc(tod(e2p()))),tpc(0))
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2p()|1)),0):(p=e1p())==0?(p=epc(e2p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(p&-2),epc(e2p()|1)),tpc(0))
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2p()|1)),0)):(p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(mix(epc(p&-2),epc(e2p()|1)),tpc(0)))
  SE2t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE2t_XHPGT

  //================================================================================
  //SE3t ($0000,$09xx,$0047)
  //  概要
  //    SE3t  スプライト＞512ドット16色3プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):epc(e3p())))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):epc(e3p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?epc(e2p())!=0?epc(e2p()):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):epc(e3p()):(v8=e1p())!=0?(v9=epc(v8))!=0?v9:tpc(0):(v11=e2p())!=0?(v12=epc(v11))!=0?v12:tpc(0):(v14=epc(e3p()))!=0?v14:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):epo(e3p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e3p()))!=0?cto(p):tpo(0)
  SE3t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE3t

  //================================================================================
  //XSE3t
  //  概要
  //    SE3t  スプライト＞512ドット16色3プレーン＞テキスト(OFF)
  //    拡張あり
  XSE3t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE3t_XWC
      case 0b00010001:  //SE3t_XWC
      case 0b00010010:  //SE3t_XWC
      case 0b00010011:  //SE3t_XWC
        SE3t_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE3t_XWP
      case 0b00010101:  //SE3t_XWP
      case 0b00010110:  //SE3t_XWP
      case 0b00010111:  //SE3t_XWP
        SE3t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE3t_XHC
        SE3t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE3t_XHCT
        SE3t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE3t_XHCG
        SE3t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE3t_XHCGT
        SE3t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE3t_XHPT
        SE3t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE3t_XHPG
        SE3t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE3t_XHPGT
        SE3t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE3t_A
      case 0b01000001:  //SE3t_A
      case 0b01000010:  //SE3t_A
      case 0b01000011:  //SE3t_A
      case 0b01000100:  //SE3t_A
      case 0b01000101:  //SE3t_A
      case 0b01000110:  //SE3t_A
      case 0b01000111:  //SE3t_A
      case 0b01001000:  //SE3t_A
      case 0b01001001:  //SE3t_A
      case 0b01001010:  //SE3t_A
      case 0b01001011:  //SE3t_A
      case 0b01001100:  //SE3t_A
      case 0b01001101:  //SE3t_A
      case 0b01001110:  //SE3t_A
      case 0b01001111:  //SE3t_A
      case 0b01010000:  //SE3t_A
      case 0b01010001:  //SE3t_A
      case 0b01010010:  //SE3t_A
      case 0b01010011:  //SE3t_A
      case 0b01010100:  //SE3t_A
      case 0b01010101:  //SE3t_A
      case 0b01010110:  //SE3t_A
      case 0b01010111:  //SE3t_A
      case 0b01011000:  //SE3t_A
      case 0b01011001:  //SE3t_A
      case 0b01011010:  //SE3t_A
      case 0b01011011:  //SE3t_A
      case 0b01011100:  //SE3t_A
      case 0b01011101:  //SE3t_A
      case 0b01011110:  //SE3t_A
      case 0b01011111:  //SE3t_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        SE3t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE3t);
      }  //switch
    }  //drawRaster
  },  //XSE3t

  //================================================================================
  //SE3t_XWC ($0000,$09xx,$1047)
  //  概要
  //    SE3t  スプライト＞512ドット16色3プレーン＞テキスト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットが0でないとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          スプライトパレットが0でないとき
  //            スプライトカラーが0でないとき
  //              スプライトカラー
  //            さもなくば(スプライトカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(スプライトパレットが0のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          スプライトパレットが0でないとき
  //            スプライトカラーが0でないとき
  //              スプライトカラー
  //            さもなくば(スプライトカラーが0のとき)
  //              3番目のカラー(0は黒)
  //          さもなくば(スプライトパレットが0のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):tpc(0)))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e3p())):(epc(e3p())!=0?epc(e3p()):tpc(0))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(0):ls1(epc(tev(e3p())))!=0?epc(e3p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e3p()):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=spp())!=0?(v6=spc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:tpc(0):(v10=e2p())!=0?ls1(epc(tev(v10)))!=0?epc(v10):(v15=spp())!=0?(v16=spc(v15))!=0?v16:epc(v10):(v18=epc(v10))!=0?v18:tpc(0):ls1(epc(tev(v23=e3p())))!=0?epc(v23):(v25=spp())!=0?(v26=spc(v25))!=0?v26:epc(v23):(v28=epc(v23))!=0?v28:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e3p())))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(epc((p=e3p())&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0)
  SE3t_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE3t_XWC

  //================================================================================
  //SE3t_XWP ($0000,$09xx,$1447)
  //  概要
  //    SE3t  スプライト＞512ドット16色3プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(spp()!=0?(spc(spp())!=0?spc(spp()):((tev(e2p()))!=0?epc(tev(e2p())):epc(tev(e3p())))):((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)))):e1p()==1?(spp()!=0?(spc(spp())!=0?spc(spp()):epc(0)):(epc(0)!=0?epc(0):tpc(0))):ls1(e1p())==0?(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(0))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?spp()!=0?spc(spp())!=0?spc(spp()):tev(e2p())!=0?epc(tev(e2p())):epc(tev(e3p())):tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):e1p()==1?spp()!=0?spc(spp())!=0?spc(spp()):epc(0):epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?spp()!=0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=spp())!=0?(v2=spc(v1))!=0?v2:(v3=tev(e2p()))!=0?epc(v3):epc(tev(e3p())):(v9=tev(e2p()))!=0?(v11=epc(v9))!=0?v11:tpc(0):(v13=epc(tev(e3p())))!=0?v13:tpc(0):v0==1?(v17=spp())!=0?(v18=spc(v17))!=0?v18:epc(0):(v20=epc(0))!=0?v20:tpc(0):ls1(v0)==0?(v23=spp())!=0?(v24=spc(v23))!=0?v24:epc(v0):(v26=epc(v0))!=0?v26:tpc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=spp())!=0?(q=spc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):epc(tev(e3p())):(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e3p())))!=0?p:tpc(0):p==1?(p=spp())!=0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=spp())!=0?(q=spc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):epc(e3p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e3p()&-2))!=0?p:tpc(0):p==1?(p=spp())!=0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):epo(e3p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e3p()&-2))!=0?cto(p):tpo(0):p==1?(p=spp())!=0?(q=spc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):epo(p&-2)
  SE3t_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE3t_XWP

  //================================================================================
  //SE3t_XHCT ($0000,$09xx,$1947)
  //  概要
  //    SE3t  スプライト＞512ドット16色3プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーと
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラーと
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0))))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):ls1(epc(tev(v19=e3p())))!=0?mix(epc(v19),0):epc(v19):(v23=e1p())!=0?ls1(epc(tev(v23)))!=0?mix(epc(v23),tpc(0)):(v30=epc(v23))!=0?v30:tpc(0):(v32=e2p())!=0?ls1(epc(tev(v32)))!=0?mix(epc(v32),tpc(0)):(v39=epc(v32))!=0?v39:tpc(0):ls1(epc(tev(v44=e3p())))!=0?mix(epc(v44),tpc(0)):(v48=epc(v44))!=0?v48:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  SE3t_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE3t_XHCT

  //================================================================================
  //SE3t_XHCG ($0000,$09xx,$1A47)
  //  概要
  //    SE3t  スプライト＞512ドット16色3プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p())))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(0))):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(0):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):ls1(v25=epc(tev(v27=e3p())))!=0?mix(v25,epc(1)):ls1(v27)!=0?epc(1):epc(v27):(v33=e1p())!=0?ls1(v35=epc(tev(v33)))!=0?mix(v35,epc(tod(e2q()))):ls1(v33)!=0?(v42=epc(tod(e2q())))!=0?v42:tpc(0):(v46=epc(v33))!=0?v46:tpc(0):(v48=e2p())!=0?ls1(v50=epc(tev(v48)))!=0?mix(v50,epc(tod(e2q()))):(v56=epc(v48))!=0?v56:tpc(0):ls1(v59=epc(tev(v61=e3p())))!=0?mix(v59,epc(1)):ls1(v61)!=0?(v65=epc(1))!=0?v65:tpc(0):(v67=epc(v61))!=0?v67:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(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):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  SE3t_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE3t_XHCG

  //================================================================================
  //SE3t_XHCGT ($0000,$09xx,$1B47)
  //  概要
  //    SE3t  スプライト＞512ドット16色3プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p())))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):ls1(v27=epc(tev(v29=e3p())))!=0?mix(mix(v27,epc(1)),0):ls1(v29)!=0?epc(1):epc(v29):(v36=e1p())!=0?ls1(v38=epc(tev(v36)))!=0?mix(mix(v38,epc(tod(e2q()))),tpc(0)):ls1(v36)!=0?(v47=epc(tod(e2q())))!=0?v47:tpc(0):(v51=epc(v36))!=0?v51:tpc(0):(v53=e2p())!=0?ls1(v55=epc(tev(v53)))!=0?mix(mix(v55,epc(tod(e2q()))),tpc(0)):(v63=epc(v53))!=0?v63:tpc(0):ls1(v66=epc(tev(v68=e3p())))!=0?mix(mix(v66,epc(1)),tpc(0)):ls1(v68)!=0?(v74=epc(1))!=0?v74:tpc(0):(v76=epc(v68))!=0?v76:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),tpc(0)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),tpc(0)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),tpc(0))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  SE3t_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE3t_XHCGT

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

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

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

  //================================================================================
  //SE4t ($0000,$09xx,$004F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のカラーが0でないとき
  //              4番目のカラー
  //            さもなくば(4番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):(e3p()!=0?epc(e3p()):epc(e4p()))))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):tpc(0)):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0))))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):e3p()!=0?epc(e3p()):epc(e4p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?epc(e3p())!=0?epc(e3p()):tpc(0):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):(v6=e3p())!=0?epc(v6):epc(e4p()):(v10=e1p())!=0?(v11=epc(v10))!=0?v11:tpc(0):(v13=e2p())!=0?(v14=epc(v13))!=0?v14:tpc(0):(v16=e3p())!=0?(v17=epc(v16))!=0?v17:tpc(0):(v19=epc(e4p()))!=0?v19:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):(p=e3p())!=0?epo(p):epo(e4p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()))!=0?cto(p):tpo(0)
  SE4t {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t

  //================================================================================
  //XSE4t
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    拡張あり
  XSE4t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SE4t_XWC
      case 0b00010001:  //SE4t_XWC
      case 0b00010010:  //SE4t_XWC
      case 0b00010011:  //SE4t_XWC
        SE4t_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SE4t_XWP
      case 0b00010101:  //SE4t_XWP
      case 0b00010110:  //SE4t_XWP
      case 0b00010111:  //SE4t_XWP
        SE4t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SE4t_XHC
        SE4t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SE4t_XHCT
        SE4t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SE4t_XHCG
        SE4t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SE4t_XHCGT
        SE4t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SE4t_XHPT
        SE4t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SE4t_XHPG
        SE4t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SE4t_XHPGT
        SE4t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SE4t_A
      case 0b01000001:  //SE4t_A
      case 0b01000010:  //SE4t_A
      case 0b01000011:  //SE4t_A
      case 0b01000100:  //SE4t_A
      case 0b01000101:  //SE4t_A
      case 0b01000110:  //SE4t_A
      case 0b01000111:  //SE4t_A
      case 0b01001000:  //SE4t_A
      case 0b01001001:  //SE4t_A
      case 0b01001010:  //SE4t_A
      case 0b01001011:  //SE4t_A
      case 0b01001100:  //SE4t_A
      case 0b01001101:  //SE4t_A
      case 0b01001110:  //SE4t_A
      case 0b01001111:  //SE4t_A
      case 0b01010000:  //SE4t_A
      case 0b01010001:  //SE4t_A
      case 0b01010010:  //SE4t_A
      case 0b01010011:  //SE4t_A
      case 0b01010100:  //SE4t_A
      case 0b01010101:  //SE4t_A
      case 0b01010110:  //SE4t_A
      case 0b01010111:  //SE4t_A
      case 0b01011000:  //SE4t_A
      case 0b01011001:  //SE4t_A
      case 0b01011010:  //SE4t_A
      case 0b01011011:  //SE4t_A
      case 0b01011100:  //SE4t_A
      case 0b01011101:  //SE4t_A
      case 0b01011110:  //SE4t_A
      case 0b01011111:  //SE4t_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        SE4t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSE4t);
      }  //switch
    }  //drawRaster
  },  //XSE4t

  //================================================================================
  //SE4t_XWC ($0000,$09xx,$104F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットが0でないとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          スプライトパレットが0でないとき
  //            スプライトカラーが0でないとき
  //              スプライトカラー
  //            さもなくば(スプライトカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(スプライトパレットが0のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            スプライトパレットが0でないとき
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(スプライトパレットが0のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            スプライトパレットが0でないとき
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                4番目のカラー(0は黒)
  //            さもなくば(スプライトパレットが0のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):tpc(0)))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e3p())):(epc(e3p())!=0?epc(e3p()):tpc(0)))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e4p())):(epc(e4p())!=0?epc(e4p()):tpc(0)))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e3p()):epc(e3p())!=0?epc(e3p()):tpc(0):ls1(epc(tev(e4p())))!=0?epc(e4p()):spp()!=0?spc(spp())!=0?spc(spp()):epc(e4p()):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=spp())!=0?(v6=spc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:tpc(0):(v10=e2p())!=0?ls1(epc(tev(v10)))!=0?epc(v10):(v15=spp())!=0?(v16=spc(v15))!=0?v16:epc(v10):(v18=epc(v10))!=0?v18:tpc(0):(v20=e3p())!=0?ls1(epc(tev(v20)))!=0?epc(v20):(v25=spp())!=0?(v26=spc(v25))!=0?v26:epc(v20):(v28=epc(v20))!=0?v28:tpc(0):ls1(epc(tev(v33=e4p())))!=0?epc(v33):(v35=spp())!=0?(v36=spc(v35))!=0?v36:epc(v33):(v38=epc(v33))!=0?v38:tpc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0)
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XWC

  //================================================================================
  //SE4t_XWP ($0000,$09xx,$144F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが0でないとき
  //              4番目のパレットを偶数化したパレットのカラー
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(spp()!=0?(spc(spp())!=0?spc(spp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p()))))):((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0))))):e1p()==1?(spp()!=0?(spc(spp())!=0?spc(spp()):epc(0)):(epc(0)!=0?epc(0):tpc(0))):ls1(e1p())==0?(spp()!=0?(spc(spp())!=0?spc(spp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):tpc(0))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?spp()!=0?spc(spp())!=0?spc(spp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?spp()!=0?spc(spp())!=0?spc(spp()):epc(0):epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?spp()!=0?spc(spp())!=0?spc(spp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):tpc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=spp())!=0?(v2=spc(v1))!=0?v2:(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):(v12=tev(e2p()))!=0?(v14=epc(v12))!=0?v14:tpc(0):(v16=tev(e3p()))!=0?(v18=epc(v16))!=0?v18:tpc(0):(v20=epc(tev(e4p())))!=0?v20:tpc(0):v0==1?(v24=spp())!=0?(v25=spc(v24))!=0?v25:epc(0):(v27=epc(0))!=0?v27:tpc(0):ls1(v0)==0?(v30=spp())!=0?(v31=spc(v30))!=0?v31:epc(v0):(v33=epc(v0))!=0?v33:tpc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=spp())!=0?(q=spc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=spp())!=0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=spp())!=0?(q=spc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=spp())!=0?(q=spc(p))!=0?q:epc(0):(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?r:epc(p):(q=epc(p))!=0?q:tpc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=spp())!=0?(q=spc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):tpo(0):epo(p&-2)
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XWP

  //================================================================================
  //SE4t_XHCT ($0000,$09xx,$194F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーと
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のカラーと
  //                テキストパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のカラーと
  //                テキストパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0)))))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),tpc(0)):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),tpc(0)):epc(e3p())!=0?epc(e3p()):tpc(0):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),tpc(0)):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),0):epc(v16):ls1(epc(tev(v26=e4p())))!=0?mix(epc(v26),0):epc(v26):(v30=e1p())!=0?ls1(epc(tev(v30)))!=0?mix(epc(v30),tpc(0)):(v37=epc(v30))!=0?v37:tpc(0):(v39=e2p())!=0?ls1(epc(tev(v39)))!=0?mix(epc(v39),tpc(0)):(v46=epc(v39))!=0?v46:tpc(0):(v48=e3p())!=0?ls1(epc(tev(v48)))!=0?mix(epc(v48),tpc(0)):(v55=epc(v48))!=0?v55:tpc(0):ls1(epc(tev(v60=e4p())))!=0?mix(epc(v60),tpc(0)):(v64=epc(v60))!=0?v64:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),tpc(0)):(q=epc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0)
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XHCT

  //================================================================================
  //SE4t_XHCG ($0000,$09xx,$1A4F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラーが0でないとき
  //                  3番目のカラー
  //                さもなくば(3番目のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //              さもなくば(4番目のパレットが偶数のとき)
  //                4番目のカラーが0でないとき
  //                  4番目のカラー
  //                さもなくば(4番目のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):tpc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0))))))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):(v24=e3p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(1)):ls1(v24)!=0?epc(1):epc(v24):ls1(v34=epc(tev(v36=e4p())))!=0?mix(v34,epc(1)):ls1(v36)!=0?epc(1):epc(v36):(v42=e1p())!=0?ls1(v44=epc(tev(v42)))!=0?mix(v44,epc(tod(e2q()))):ls1(v42)!=0?(v51=epc(tod(e2q())))!=0?v51:tpc(0):(v55=epc(v42))!=0?v55:tpc(0):(v57=e2p())!=0?ls1(v59=epc(tev(v57)))!=0?mix(v59,epc(tod(e2q()))):(v65=epc(v57))!=0?v65:tpc(0):(v67=e3p())!=0?ls1(v69=epc(tev(v67)))!=0?mix(v69,epc(1)):ls1(v67)!=0?(v74=epc(1))!=0?v74:tpc(0):(v76=epc(v67))!=0?v76:tpc(0):ls1(v79=epc(tev(v81=e4p())))!=0?mix(v79,epc(1)):ls1(v81)!=0?(v85=epc(1))!=0?v85:tpc(0):(v87=epc(v81))!=0?v87:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(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):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XHCG

  //================================================================================
  //SE4t_XHCGT ($0000,$09xx,$1B4F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //              テキストパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //                テキストパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラーが0でないとき
  //                  3番目のカラー
  //                さもなくば(3番目のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //                テキストパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //              さもなくば(4番目のパレットが偶数のとき)
  //                4番目のカラーが0でないとき
  //                  4番目のカラー
  //                さもなくば(4番目のカラーが0のとき)
  //                  テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0)):(epc(e1p())!=0?epc(e1p()):tpc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):(epc(e2p())!=0?epc(e2p()):tpc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e3p())!=0?epc(e3p()):tpc(0)))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(0)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):tpc(0)):(epc(e4p())!=0?epc(e4p()):tpc(0))))))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):tpc(0):epc(e1p())!=0?epc(e1p()):tpc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),tpc(0)):epc(e2p())!=0?epc(e2p()):tpc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),tpc(0)):ls1(e3p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e3p())!=0?epc(e3p()):tpc(0):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),tpc(0)):ls1(e4p())!=0?epc(1)!=0?epc(1):tpc(0):epc(e4p())!=0?epc(e4p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):(v26=e3p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(1)),0):ls1(v26)!=0?epc(1):epc(v26):ls1(v37=epc(tev(v39=e4p())))!=0?mix(mix(v37,epc(1)),0):ls1(v39)!=0?epc(1):epc(v39):(v46=e1p())!=0?ls1(v48=epc(tev(v46)))!=0?mix(mix(v48,epc(tod(e2q()))),tpc(0)):ls1(v46)!=0?(v57=epc(tod(e2q())))!=0?v57:tpc(0):(v61=epc(v46))!=0?v61:tpc(0):(v63=e2p())!=0?ls1(v65=epc(tev(v63)))!=0?mix(mix(v65,epc(tod(e2q()))),tpc(0)):(v73=epc(v63))!=0?v73:tpc(0):(v75=e3p())!=0?ls1(v77=epc(tev(v75)))!=0?mix(mix(v77,epc(1)),tpc(0)):ls1(v75)!=0?(v84=epc(1))!=0?v84:tpc(0):(v86=epc(v75))!=0?v86:tpc(0):ls1(v89=epc(tev(v91=e4p())))!=0?mix(mix(v89,epc(1)),tpc(0)):ls1(v91)!=0?(v97=epc(1))!=0?v97:tpc(0):(v99=epc(v91))!=0?v99:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),tpc(0)):ls1(p)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),tpc(0)):ls1(q)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),tpc(0)):(q=epc(p))!=0?q:tpc(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),tpc(0)):(p&1)!=0?(p=epc(1))!=0?p:tpc(0):(q=epc(p))!=0?q:tpc(0):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),tpc(0)):(q&1)!=0?(p=epc(1))!=0?p:tpc(0):(p=epc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),tpc(0))):(q=epc(p))!=0?cto(q):tpo(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),tpc(0))):(p&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(q=epc(p))!=0?cto(q):tpo(0):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),tpc(0))):(q&1)!=0?(p=epc(1))!=0?cto(p):tpo(0):(p=epc(q))!=0?cto(p):tpo(0)
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XHCGT

  //================================================================================
  //SE4t_XHPT ($0000,$09xx,$1D4F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが0でないとき
  //              4番目のパレットを偶数化したパレットのカラー
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))):(e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0)))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(epc(tev(e1p())),tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0):e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),tpc(0))
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0):(v18=e1p())==0?(v19=tev(e2p()))!=0?(v21=epc(v19))!=0?v21:tpc(0):(v23=tev(e3p()))!=0?(v25=epc(v23))!=0?v25:tpc(0):(v27=epc(tev(e4p())))!=0?v27:tpc(0):v18==1?(v31=epc(0))!=0?v31:tpc(0):ls1(v18)==0?(v34=epc(v18))!=0?v34:tpc(0):mix(epc(tev(v18)),tpc(0))
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0):(p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(tev(p)),tpc(0))
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(epc(p&-2),tpc(0))
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0)):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(epc(p&-2),tpc(0)))
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XHPT

  //================================================================================
  //SE4t_XHPG ($0000,$09xx,$1E4F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが0でないとき
  //              4番目のパレットを偶数化したパレットのカラー
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0)))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q()))):(v21=e1p())==0?(v22=tev(e2p()))!=0?(v24=epc(v22))!=0?v24:tpc(0):(v26=tev(e3p()))!=0?(v28=epc(v26))!=0?v28:tpc(0):(v30=epc(tev(e4p())))!=0?v30:tpc(0):v21==1?(v34=epc(0))!=0?v34:tpc(0):ls1(v21)==0?(v37=epc(v21))!=0?v37:tpc(0):(v39=mix(epc(tev(v21)),epc(tod(e2q()))))!=0?v39:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):tpo(0)
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XHPG

  //================================================================================
  //SE4t_XHPGT ($0000,$09xx,$1F4F)
  //  概要
  //    SE4t  スプライト＞512ドット16色4プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが0でないとき
  //              4番目のパレットを偶数化したパレットのカラー
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0))):(e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0)))):e1p()==1?(epc(0)!=0?epc(0):tpc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):tpc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):tpc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):tpc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):tpc(0):e1p()==1?epc(0)!=0?epc(0):tpc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):tpc(0):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),tpc(0))
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0):(v22=e1p())==0?(v23=tev(e2p()))!=0?(v25=epc(v23))!=0?v25:tpc(0):(v27=tev(e3p()))!=0?(v29=epc(v27))!=0?v29:tpc(0):(v31=epc(tev(e4p())))!=0?v31:tpc(0):v22==1?(v35=epc(0))!=0?v35:tpc(0):ls1(v22)==0?(v38=epc(v22))!=0?v38:tpc(0):mix(mix(epc(tev(v22)),epc(tod(e2q()))),tpc(0))
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0):(p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(tev(e4p())))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):ls1(p)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(tev(p)),epc(tod(e2q()))),tpc(0))
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:tpc(0):(p=epc(e4p()&-2))!=0?p:tpc(0):p==1?(p=epc(0))!=0?p:tpc(0):(p&1)==0?(q=epc(p))!=0?q:tpc(0):mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0))
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0)):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):tpo(0):(p=epc(e4p()&-2))!=0?cto(p):tpo(0):p==1?(p=epc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=epc(p))!=0?cto(q):tpo(0):cto(mix(mix(epc(p&-2),epc(e2q()|1)),tpc(0)))
  SE4t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SE4t_XHPGT

  //================================================================================
  //SF1t ($0001,$09xx,$0043)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    拡張なし
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(0)))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:fpc(f1p()):(v4=fpc(f1p()))!=0?v4:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):fpo(f1p()):(p=fpc(f1p()))!=0?cto(p):tpo(0)
  SF1t {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t

  //================================================================================
  //XSF1t
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    拡張あり
  XSF1t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SF1t_XWC
      case 0b00010001:  //SF1t_XWC
      case 0b00010010:  //SF1t_XWC
      case 0b00010011:  //SF1t_XWC
        SF1t_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SF1t_XWP
      case 0b00010101:  //SF1t_XWP
      case 0b00010110:  //SF1t_XWP
      case 0b00010111:  //SF1t_XWP
        SF1t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SF1t_XHC
        SF1t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SF1t_XHCT
        SF1t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SF1t_XHCG
        SF1t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SF1t_XHCGT
        SF1t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SF1t_XHPT
        SF1t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SF1t_XHPG
        SF1t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SF1t_XHPGT
        SF1t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SF1t_A
      case 0b01000001:  //SF1t_A
      case 0b01000010:  //SF1t_A
      case 0b01000011:  //SF1t_A
      case 0b01000100:  //SF1t_A
      case 0b01000101:  //SF1t_A
      case 0b01000110:  //SF1t_A
      case 0b01000111:  //SF1t_A
      case 0b01001000:  //SF1t_A
      case 0b01001001:  //SF1t_A
      case 0b01001010:  //SF1t_A
      case 0b01001011:  //SF1t_A
      case 0b01001100:  //SF1t_A
      case 0b01001101:  //SF1t_A
      case 0b01001110:  //SF1t_A
      case 0b01001111:  //SF1t_A
      case 0b01010000:  //SF1t_A
      case 0b01010001:  //SF1t_A
      case 0b01010010:  //SF1t_A
      case 0b01010011:  //SF1t_A
      case 0b01010100:  //SF1t_A
      case 0b01010101:  //SF1t_A
      case 0b01010110:  //SF1t_A
      case 0b01010111:  //SF1t_A
      case 0b01011000:  //SF1t_A
      case 0b01011001:  //SF1t_A
      case 0b01011010:  //SF1t_A
      case 0b01011011:  //SF1t_A
      case 0b01011100:  //SF1t_A
      case 0b01011101:  //SF1t_A
      case 0b01011110:  //SF1t_A
      case 0b01011111:  //SF1t_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        SF1t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSF1t);
      }  //switch
    }  //drawRaster
  },  //XSF1t

  //================================================================================
  //SF1t_XWC ($0001,$09xx,$1043)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(0))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):spp()!=0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=spp())!=0?(v6=spc(v5))!=0?v6:fpc(v3):(v8=fpc(v3))!=0?v8:tpc(0)
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(0)
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XWC

  //================================================================================
  //SF1t_XWP ($0001,$09xx,$1443)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(0)):(fpc(0)!=0?fpc(0):tpc(0))):ls1(f1p())==0?(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(0))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?spp()!=0?spc(spp())!=0?spc(spp()):fpc(0):fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?spp()!=0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(0):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=spp())!=0?(v2=spc(v1))!=0?v2:fpc(0):(v4=fpc(0))!=0?v4:tpc(0):ls1(v0)==0?(v7=spp())!=0?(v8=spc(v7))!=0?v8:fpc(v0):(v10=fpc(v0))!=0?v10:tpc(0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=spp())!=0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=spp())!=0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=spp())!=0?(q=spc(p))!=0?cto(q):fpo(0):(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(0):fpo(p&-2)
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XWP

  //================================================================================
  //SF1t_XHCT ($0001,$09xx,$1943)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()))):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(0)):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:ls1(fpc(tev(v5=f1p())))!=0?mix(fpc(v5),0):fpc(v5):ls1(fpc(tev(v12=f1p())))!=0?mix(fpc(v12),tpc(0)):(v16=fpc(v12))!=0?v16:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),0):fpc(p):ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),0):fpc(p):(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),tpc(0))):(q=fpc(p))!=0?cto(q):tpo(0)
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XHCT

  //================================================================================
  //SF1t_XHCG ($0001,$09xx,$1A43)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(v3,fpc(tod(f2q()))):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5):ls1(v16=fpc(tev(v18=f1p())))!=0?mix(v16,fpc(tod(f2q()))):ls1(v18)!=0?(v24=fpc(tod(f2q())))!=0?v24:tpc(0):(v28=fpc(v18))!=0?v28:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?fpc(tod(f2q())):fpc(q):ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?fpc(f2q()|1):fpc(q):((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?fpo(f2q()|1):fpo(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(0):(p=fpc(q))!=0?cto(p):tpo(0)
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XHCG

  //================================================================================
  //SF1t_XHCGT ($0001,$09xx,$1B43)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))):(ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0)):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0)):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0):fpc(f1p())!=0?fpc(f1p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(mix(v3,fpc(tod(f2q()))),0):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5):ls1(v17=fpc(tev(v19=f1p())))!=0?mix(mix(v17,fpc(tod(f2q()))),tpc(0)):ls1(v19)!=0?(v27=fpc(tod(f2q())))!=0?v27:tpc(0):(v31=fpc(v19))!=0?v31:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),0):ls1(q)!=0?fpc(tod(f2q())):fpc(q):ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),tpc(0)):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),0):(q&1)!=0?fpc(f2q()|1):fpc(q):((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),tpc(0)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(0):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),0)):(q&1)!=0?fpo(f2q()|1):fpo(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),tpc(0))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):tpo(0):(p=fpc(q))!=0?cto(p):tpo(0)
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0])] :
                                (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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XHCGT

  //================================================================================
  //SF1t_XHPT ($0001,$09xx,$1D43)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0))):(f1p()<=1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):mix(fpc(tev(f1p())),tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),0):f1p()<=1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):mix(fpc(tev(f1p())),tpc(0))
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=f1p())<=1?fpc(0):ls1(v2)==0?fpc(v2):mix(fpc(tev(v2)),0):(v9=f1p())<=1?(v10=fpc(0))!=0?v10:tpc(0):ls1(v9)==0?(v13=fpc(v9))!=0?v13:tpc(0):mix(fpc(tev(v9)),tpc(0))
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),0):(p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):mix(fpc(tev(p)),tpc(0))
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),0):(p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):mix(fpc(p&-2),tpc(0))
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),0)):(p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):cto(mix(fpc(p&-2),tpc(0)))
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XHPT

  //================================================================================
  //SF1t_XHPG ($0001,$09xx,$1E43)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2q()))))):(f1p()<=1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):(mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(fpc(tev(f1p())),fpc(tod(f2q()))):f1p()<=1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):mix(fpc(tev(f1p())),fpc(tod(f2q())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=f1p())<=1?fpc(0):ls1(v2)==0?fpc(v2):mix(fpc(tev(v2)),fpc(tod(f2q()))):(v12=f1p())<=1?(v13=fpc(0))!=0?v13:tpc(0):ls1(v12)==0?(v16=fpc(v12))!=0?v16:tpc(0):(v18=mix(fpc(tev(v12)),fpc(tod(f2q()))))!=0?v18:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(fpc(tev(p)),fpc(tod(f2q()))):(p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):(q=mix(fpc(tev(p)),fpc(tod(f2q()))))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(fpc(p&-2),fpc(f2q()|1)):(p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(fpc(p&-2),fpc(f2q()|1))):(p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):(q=mix(fpc(p&-2),fpc(f2q()|1)))!=0?cto(q):tpo(0)
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XHPG

  //================================================================================
  //SF1t_XHPGT ($0001,$09xx,$1F43)
  //  概要
  //    SF1t  スプライト＞512ドット256色1プレーン＞テキスト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0))):(f1p()<=1?(fpc(0)!=0?fpc(0):tpc(0)):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):tpc(0)):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):f1p()<=1?fpc(0):ls1(f1p())==0?fpc(f1p()):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):f1p()<=1?fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):tpc(0):mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),tpc(0))
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=f1p())<=1?fpc(0):ls1(v2)==0?fpc(v2):mix(mix(fpc(tev(v2)),fpc(tod(f2q()))),0):(v13=f1p())<=1?(v14=fpc(0))!=0?v14:tpc(0):ls1(v13)==0?(v17=fpc(v13))!=0?v17:tpc(0):mix(mix(fpc(tev(v13)),fpc(tod(f2q()))),tpc(0))
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())<=1?fpc(0):ls1(p)==0?fpc(p):mix(mix(fpc(tev(p)),fpc(tod(f2q()))),0):(p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=fpc(p))!=0?q:tpc(0):mix(mix(fpc(tev(p)),fpc(tod(f2q()))),tpc(0))
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())<=1?fpc(0):(p&1)==0?fpc(p):mix(mix(fpc(p&-2),fpc(f2q()|1)),0):(p=f1p())<=1?(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=fpc(p))!=0?q:tpc(0):mix(mix(fpc(p&-2),fpc(f2q()|1)),tpc(0))
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=f1p())<=1?fpo(0):(p&1)==0?fpo(p):cto(mix(mix(fpc(p&-2),fpc(f2q()|1)),0)):(p=f1p())<=1?(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=fpc(p))!=0?cto(q):tpo(0):cto(mix(mix(fpc(p&-2),fpc(f2q()|1)),tpc(0)))
  SF1t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                0)] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                0)] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            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[0])]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                    0)] :
                                (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[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                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[0])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF1t_XHPGT

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

  //================================================================================
  //XSF2t
  //  概要
  //    SF2t  スプライト＞512ドット256色2プレーン＞テキスト(OFF)
  //    拡張あり
  XSF2t {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //SF2t_XWC
      case 0b00010001:  //SF2t_XWC
      case 0b00010010:  //SF2t_XWC
      case 0b00010011:  //SF2t_XWC
        SF2t_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //SF2t_XWP
      case 0b00010101:  //SF2t_XWP
      case 0b00010110:  //SF2t_XWP
      case 0b00010111:  //SF2t_XWP
        SF2t_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //SF2t_XHC
        SF2t.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //SF2t_XHCT
        SF2t_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //SF2t_XHCG
        SF2t_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //SF2t_XHCGT
        SF2t_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //SF2t_XHPT
        SF2t_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //SF2t_XHPG
        SF2t_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //SF2t_XHPGT
        SF2t_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //SF2t_A
      case 0b01000001:  //SF2t_A
      case 0b01000010:  //SF2t_A
      case 0b01000011:  //SF2t_A
      case 0b01000100:  //SF2t_A
      case 0b01000101:  //SF2t_A
      case 0b01000110:  //SF2t_A
      case 0b01000111:  //SF2t_A
      case 0b01001000:  //SF2t_A
      case 0b01001001:  //SF2t_A
      case 0b01001010:  //SF2t_A
      case 0b01001011:  //SF2t_A
      case 0b01001100:  //SF2t_A
      case 0b01001101:  //SF2t_A
      case 0b01001110:  //SF2t_A
      case 0b01001111:  //SF2t_A
      case 0b01010000:  //SF2t_A
      case 0b01010001:  //SF2t_A
      case 0b01010010:  //SF2t_A
      case 0b01010011:  //SF2t_A
      case 0b01010100:  //SF2t_A
      case 0b01010101:  //SF2t_A
      case 0b01010110:  //SF2t_A
      case 0b01010111:  //SF2t_A
      case 0b01011000:  //SF2t_A
      case 0b01011001:  //SF2t_A
      case 0b01011010:  //SF2t_A
      case 0b01011011:  //SF2t_A
      case 0b01011100:  //SF2t_A
      case 0b01011101:  //SF2t_A
      case 0b01011110:  //SF2t_A
      case 0b01011111:  //SF2t_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        SF2t.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSF2t);
      }  //switch
    }  //drawRaster
  },  //XSF2t

  //================================================================================
  //SF2t_XWC ($0001,$09xx,$104F)
  //  概要
  //    SF2t  スプライト＞512ドット256色2プレーン＞テキスト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットが0でないとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットが0でないとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(スプライトパレットが0のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(0)))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(f2p())):(fpc(f2p())!=0?fpc(f2p()):tpc(0)))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):spp()!=0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(0):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):spp()!=0?spc(spp())!=0?spc(spp()):fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):tpc(0)
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=spp())!=0?(v6=spc(v5))!=0?v6:fpc(v0):(v8=fpc(v0))!=0?v8:tpc(0):ls1(fpc(tev(v13=f2p())))!=0?fpc(v13):(v15=spp())!=0?(v16=spc(v15))!=0?v16:fpc(v13):(v18=fpc(v13))!=0?v18:tpc(0)
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(0):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=spp())!=0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(0)
  SF2t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          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 = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF2t_XWC

  //================================================================================
  //SF2t_XWP ($0001,$09xx,$144F)
  //  概要
  //    SF2t  スプライト＞512ドット256色2プレーン＞テキスト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットが0でないとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(tev(f2p()))):(fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(0))):f1p()==1?(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(0)):(fpc(0)!=0?fpc(0):tpc(0))):ls1(f1p())==0?(spp()!=0?(spc(spp())!=0?spc(spp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):tpc(0))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?spp()!=0?spc(spp())!=0?spc(spp()):fpc(tev(f2p())):fpc(tev(f2p()))!=0?fpc(tev(f2p())):tpc(0):f1p()==1?spp()!=0?spc(spp())!=0?spc(spp()):fpc(0):fpc(0)!=0?fpc(0):tpc(0):ls1(f1p())==0?spp()!=0?spc(spp())!=0?spc(spp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):tpc(0):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=spp())!=0?(v2=spc(v1))!=0?v2:fpc(tev(f2p())):(v6=fpc(tev(f2p())))!=0?v6:tpc(0):v0==1?(v10=spp())!=0?(v11=spc(v10))!=0?v11:fpc(0):(v13=fpc(0))!=0?v13:tpc(0):ls1(v0)==0?(v16=spp())!=0?(v17=spc(v16))!=0?v17:fpc(v0):(v19=fpc(v0))!=0?v19:tpc(0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?(p=spp())!=0?(q=spc(p))!=0?q:fpc(tev(f2p())):(p=fpc(tev(f2p())))!=0?p:tpc(0):p==1?(p=spp())!=0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(0):ls1(p)==0?(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?(p=spp())!=0?(q=spc(p))!=0?q:fpc(f2p()&-2):(p=fpc(f2p()&-2))!=0?p:tpc(0):p==1?(p=spp())!=0?(q=spc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:tpc(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:tpc(0):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?(p=spp())!=0?(q=spc(p))!=0?cto(q):fpo(f2p()&-2):(p=fpc(f2p()&-2))!=0?cto(p):tpo(0):p==1?(p=spp())!=0?(q=spc(p))!=0?cto(q):fpo(0):(p=fpc(0))!=0?cto(p):tpo(0):(p&1)==0?(q=spp())!=0?(r=spc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):tpo(0):fpo(p&-2)
  SF2t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                             GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) == 0 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF2t_XWP

  //================================================================================
  //SF2t_XHCT ($0001,$09xx,$194F)
  //  概要
  //    SF2t  スプライト＞512ドット256色2プレーン＞テキスト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーと
  //            テキストパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p())))):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),tpc(0)):(fpc(f2p())!=0?fpc(f2p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),tpc(0)):fpc(f1p())!=0?fpc(f1p()):tpc(0):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),tpc(0)):fpc(f2p())!=0?fpc(f2p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=f1p())!=0?ls1(fpc(tev(v2)))!=0?mix(fpc(v2),0):fpc(v2):ls1(fpc(tev(v12=f2p())))!=0?mix(fpc(v12),0):fpc(v12):(v16=f1p())!=0?ls1(fpc(tev(v16)))!=0?mix(fpc(v16),tpc(0)):(v23=fpc(v16))!=0?v23:tpc(0):ls1(fpc(tev(v28=f2p())))!=0?mix(fpc(v28),tpc(0)):(v32=fpc(v28))!=0?v32:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),0):fpc(p):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),0):fpc(p):(p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),0):fpc(p):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),0):fpc(p):(p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),tpc(0)):(q=fpc(p))!=0?q:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),tpc(0))):(q=fpc(p))!=0?cto(q):tpo(0):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),tpc(0))):(q=fpc(p))!=0?cto(q):tpo(0)
  SF2t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF2t_XHCT

  //================================================================================
  //SF2t_XHCG ($0001,$09xx,$1A4F)
  //  概要
  //    SF2t  スプライト＞512ドット256色2プレーン＞テキスト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレット0のカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())))):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0)):(fpc(f1p())!=0?fpc(f1p()):tpc(0)))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):(fpc(f2p())!=0?fpc(f2p()):tpc(0)))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):tpc(0):fpc(f1p())!=0?fpc(f1p()):tpc(0):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())!=0?fpc(f2p()):tpc(0)
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=f1p())!=0?ls1(v4=fpc(tev(v2)))!=0?mix(v4,fpc(tod(f2q()))):ls1(v2)!=0?fpc(tod(f2q())):fpc(v2):ls1(v16=fpc(tev(v18=f2p())))!=0?mix(v16,fpc(tod(f2q()))):fpc(v18):(v24=f1p())!=0?ls1(v26=fpc(tev(v24)))!=0?mix(v26,fpc(tod(f2q()))):ls1(v24)!=0?(v33=fpc(tod(f2q())))!=0?v33:tpc(0):(v37=fpc(v24))!=0?v37:tpc(0):ls1(v40=fpc(tev(v42=f2p())))!=0?mix(v40,fpc(tod(f2q()))):(v47=fpc(v42))!=0?v47:tpc(0)
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?fpc(tod(f2q())):fpc(p):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):fpc(q):(p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?(p=fpc(tod(f2q())))!=0?p:tpc(0):(q=fpc(p))!=0?q:tpc(0):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?fpc(f2q()|1):fpc(p):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):fpc(q):(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?(p=fpc(f2q()|1))!=0?p:tpc(0):(q=fpc(p))!=0?q:tpc(0):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(p=fpc(q))!=0?p:tpc(0)
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(q,fpc(f2q()|1))):(p&1)!=0?fpo(f2q()|1):fpo(p):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):fpo(q):(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):tpo(0):(q=fpc(p))!=0?cto(q):tpo(0):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(p=fpc(q))!=0?cto(p):tpo(0)
  SF2t_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0]);
          XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //SF2t_XHCG

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //SJt_XHPT ($0007,$09xx,$1D50)
  //  概要
  //    SJt  スプライト＞1024ドット65536色1プレーン＞テキスト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットが0でないとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(スプライトパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと
  //          テキストパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (spp()!=0?(spc(spp())!=0?spc(spp()):(j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0))):(j1p()<=1?(jpc(0,0)!=0?jpc(0,0):tpc(0)):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0)):mix(jpc(tev(j1p()),tev(j1p())),tpc(0))))
  //  中間コード2
  //    spp()!=0?spc(spp())!=0?spc(spp()):j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0):j1p()<=1?jpc(0,0)!=0?jpc(0,0):tpc(0):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):tpc(0):mix(jpc(tev(j1p()),tev(j1p())),tpc(0))
  //  中間コード3
  //    (v0=spp())!=0?(v1=spc(v0))!=0?v1:(v2=j1p())<=1?jpc(0,0):ls1(v2)==0?jpc(v2,v2):mix(jpc(v8=tev(v2),v8),0):(v9=j1p())<=1?(v10=jpc(0,0))!=0?v10:tpc(0):ls1(v9)==0?(v13=jpc(v9,v9))!=0?v13:tpc(0):mix(jpc(v17=tev(v9),v17),tpc(0))
  //  中間コード4
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=j1p())<=1?jpc(0,0):ls1(p)==0?jpc(p,p):mix(jpc(q=tev(p),q),0):(p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):ls1(p)==0?(q=jpc(p,p))!=0?q:tpc(0):mix(jpc(q=tev(p),q),tpc(0))
  //  中間コード5
  //    (p=spp())!=0?(q=spc(p))!=0?q:(p=j1p())<=1?jpc(0,0):(p&1)==0?jpc(p,p):mix(jpc(q=p&-2,q),0):(p=j1p())<=1?(p=jpc(0,0))!=0?p:tpc(0):(p&1)==0?(q=jpc(p,p))!=0?q:tpc(0):mix(jpc(q=p&-2,q),tpc(0))
  //  中間コード6
  //    (p=spp())!=0?(q=spc(p))!=0?cto(q):(p=j1p())<=1?jpo(0,0):(p&1)==0?jpo(p,p):cto(mix(jpc(q=p&-2,q),0)):(p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):tpo(0):(p&1)==0?(q=jpc(p,p))!=0?cto(q):tpo(0):cto(mix(jpc(q=p&-2,q),tpc(0)))
  SJt_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                              (q = VideoController.vcnPal16TS[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            sx += 8;
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[0])]);
              sx++;
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                              (q = VideoController.vcnPal16TS[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = ((p = SpriteScreen.sprBuffer[sx + 1]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = ((p = SpriteScreen.sprBuffer[sx + 2]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = ((p = SpriteScreen.sprBuffer[sx + 3]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = ((p = SpriteScreen.sprBuffer[sx + 4]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = ((p = SpriteScreen.sprBuffer[sx + 5]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = ((p = SpriteScreen.sprBuffer[sx + 6]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = ((p = SpriteScreen.sprBuffer[sx + 7]) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            sx += 8;
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = SpriteScreen.sprBuffer[sx]) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[0])]);
              sx++;
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //SJt_XHPT

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

  //================================================================================
  //XSTE1
  //  概要
  //    STE1  スプライト＞テキスト＞512ドット16色1プレーン
  //    拡張あり
  XSTE1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //STE1_XWC
      case 0b00010001:  //STE1_XWC
      case 0b00010010:  //STE1_XWC
      case 0b00010011:  //STE1_XWC
        STE1_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //STE1_XWP
      case 0b00010101:  //STE1_XWP
      case 0b00010110:  //STE1_XWP
      case 0b00010111:  //STE1_XWP
        STE1_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //STE1_XHC
        STE1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //STE1_XHCT
        STE1_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //STE1_XHCG
        STE1_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //STE1_XHCGT
        STE1_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //STE1_XHPT
        STE1_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //STE1_XHPG
        STE1_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //STE1_XHPGT
        STE1_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //STE1_A
      case 0b01000001:  //STE1_A
      case 0b01000010:  //STE1_A
      case 0b01000011:  //STE1_A
      case 0b01000100:  //STE1_A
      case 0b01000101:  //STE1_A
      case 0b01000110:  //STE1_A
      case 0b01000111:  //STE1_A
      case 0b01001000:  //STE1_A
      case 0b01001001:  //STE1_A
      case 0b01001010:  //STE1_A
      case 0b01001011:  //STE1_A
      case 0b01001100:  //STE1_A
      case 0b01001101:  //STE1_A
      case 0b01001110:  //STE1_A
      case 0b01001111:  //STE1_A
      case 0b01010000:  //STE1_A
      case 0b01010001:  //STE1_A
      case 0b01010010:  //STE1_A
      case 0b01010011:  //STE1_A
      case 0b01010100:  //STE1_A
      case 0b01010101:  //STE1_A
      case 0b01010110:  //STE1_A
      case 0b01010111:  //STE1_A
      case 0b01011000:  //STE1_A
      case 0b01011001:  //STE1_A
      case 0b01011010:  //STE1_A
      case 0b01011011:  //STE1_A
      case 0b01011100:  //STE1_A
      case 0b01011101:  //STE1_A
      case 0b01011110:  //STE1_A
      case 0b01011111:  //STE1_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        STE1.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSTE1);
      }  //switch
    }  //drawRaster
  },  //XSTE1

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XSTE2
  //  概要
  //    STE2  スプライト＞テキスト＞512ドット16色2プレーン
  //    拡張あり
  XSTE2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //STE2_XWC
      case 0b00010001:  //STE2_XWC
      case 0b00010010:  //STE2_XWC
      case 0b00010011:  //STE2_XWC
        STE2_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //STE2_XWP
      case 0b00010101:  //STE2_XWP
      case 0b00010110:  //STE2_XWP
      case 0b00010111:  //STE2_XWP
        STE2_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //STE2_XHC
        STE2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //STE2_XHCT
        STE2_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //STE2_XHCG
        STE2_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //STE2_XHCGT
        STE2_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //STE2_XHPT
        STE2_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //STE2_XHPG
        STE2_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //STE2_XHPGT
        STE2_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //STE2_A
      case 0b01000001:  //STE2_A
      case 0b01000010:  //STE2_A
      case 0b01000011:  //STE2_A
      case 0b01000100:  //STE2_A
      case 0b01000101:  //STE2_A
      case 0b01000110:  //STE2_A
      case 0b01000111:  //STE2_A
      case 0b01001000:  //STE2_A
      case 0b01001001:  //STE2_A
      case 0b01001010:  //STE2_A
      case 0b01001011:  //STE2_A
      case 0b01001100:  //STE2_A
      case 0b01001101:  //STE2_A
      case 0b01001110:  //STE2_A
      case 0b01001111:  //STE2_A
      case 0b01010000:  //STE2_A
      case 0b01010001:  //STE2_A
      case 0b01010010:  //STE2_A
      case 0b01010011:  //STE2_A
      case 0b01010100:  //STE2_A
      case 0b01010101:  //STE2_A
      case 0b01010110:  //STE2_A
      case 0b01010111:  //STE2_A
      case 0b01011000:  //STE2_A
      case 0b01011001:  //STE2_A
      case 0b01011010:  //STE2_A
      case 0b01011011:  //STE2_A
      case 0b01011100:  //STE2_A
      case 0b01011101:  //STE2_A
      case 0b01011110:  //STE2_A
      case 0b01011111:  //STE2_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        STE2.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSTE2);
      }  //switch
    }  //drawRaster
  },  //XSTE2

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XSTE3
  //  概要
  //    STE3  スプライト＞テキスト＞512ドット16色3プレーン
  //    拡張あり
  XSTE3 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //STE3_XWC
      case 0b00010001:  //STE3_XWC
      case 0b00010010:  //STE3_XWC
      case 0b00010011:  //STE3_XWC
        STE3_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //STE3_XWP
      case 0b00010101:  //STE3_XWP
      case 0b00010110:  //STE3_XWP
      case 0b00010111:  //STE3_XWP
        STE3_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //STE3_XHC
        STE3.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //STE3_XHCT
        STE3_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //STE3_XHCG
        STE3_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //STE3_XHCGT
        STE3_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //STE3_XHPT
        STE3_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //STE3_XHPG
        STE3_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //STE3_XHPGT
        STE3_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //STE3_A
      case 0b01000001:  //STE3_A
      case 0b01000010:  //STE3_A
      case 0b01000011:  //STE3_A
      case 0b01000100:  //STE3_A
      case 0b01000101:  //STE3_A
      case 0b01000110:  //STE3_A
      case 0b01000111:  //STE3_A
      case 0b01001000:  //STE3_A
      case 0b01001001:  //STE3_A
      case 0b01001010:  //STE3_A
      case 0b01001011:  //STE3_A
      case 0b01001100:  //STE3_A
      case 0b01001101:  //STE3_A
      case 0b01001110:  //STE3_A
      case 0b01001111:  //STE3_A
      case 0b01010000:  //STE3_A
      case 0b01010001:  //STE3_A
      case 0b01010010:  //STE3_A
      case 0b01010011:  //STE3_A
      case 0b01010100:  //STE3_A
      case 0b01010101:  //STE3_A
      case 0b01010110:  //STE3_A
      case 0b01010111:  //STE3_A
      case 0b01011000:  //STE3_A
      case 0b01011001:  //STE3_A
      case 0b01011010:  //STE3_A
      case 0b01011011:  //STE3_A
      case 0b01011100:  //STE3_A
      case 0b01011101:  //STE3_A
      case 0b01011110:  //STE3_A
      case 0b01011111:  //STE3_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        STE3.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSTE3);
      }  //switch
    }  //drawRaster
  },  //XSTE3

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XSTE4
  //  概要
  //    STE4  スプライト＞テキスト＞512ドット16色4プレーン
  //    拡張あり
  XSTE4 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //STE4_XWC
      case 0b00010001:  //STE4_XWC
      case 0b00010010:  //STE4_XWC
      case 0b00010011:  //STE4_XWC
        STE4_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //STE4_XWP
      case 0b00010101:  //STE4_XWP
      case 0b00010110:  //STE4_XWP
      case 0b00010111:  //STE4_XWP
        STE4_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //STE4_XHC
        STE4.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //STE4_XHCT
        STE4_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //STE4_XHCG
        STE4_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //STE4_XHCGT
        STE4_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //STE4_XHPT
        STE4_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //STE4_XHPG
        STE4_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //STE4_XHPGT
        STE4_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //STE4_A
      case 0b01000001:  //STE4_A
      case 0b01000010:  //STE4_A
      case 0b01000011:  //STE4_A
      case 0b01000100:  //STE4_A
      case 0b01000101:  //STE4_A
      case 0b01000110:  //STE4_A
      case 0b01000111:  //STE4_A
      case 0b01001000:  //STE4_A
      case 0b01001001:  //STE4_A
      case 0b01001010:  //STE4_A
      case 0b01001011:  //STE4_A
      case 0b01001100:  //STE4_A
      case 0b01001101:  //STE4_A
      case 0b01001110:  //STE4_A
      case 0b01001111:  //STE4_A
      case 0b01010000:  //STE4_A
      case 0b01010001:  //STE4_A
      case 0b01010010:  //STE4_A
      case 0b01010011:  //STE4_A
      case 0b01010100:  //STE4_A
      case 0b01010101:  //STE4_A
      case 0b01010110:  //STE4_A
      case 0b01010111:  //STE4_A
      case 0b01011000:  //STE4_A
      case 0b01011001:  //STE4_A
      case 0b01011010:  //STE4_A
      case 0b01011011:  //STE4_A
      case 0b01011100:  //STE4_A
      case 0b01011101:  //STE4_A
      case 0b01011110:  //STE4_A
      case 0b01011111:  //STE4_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        STE4.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSTE4);
      }  //switch
    }  //drawRaster
  },  //XSTE4

  //================================================================================
  //STE4_XWC ($0000,$06xx,$106F)
  //  概要
  //    STE4  スプライト＞テキスト＞512ドット16色4プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //            スプライトカラーが0でないとき
  //              スプライトカラー
  //            さもなくば(スプライトカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                4番目のカラー(0は黒)
  //            さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                4番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):epc(e1p())):(tpc(txp())!=0?tpc(txp()):epc(e1p())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):epc(e2p())):(tpc(txp())!=0?tpc(txp()):epc(e2p())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):epc(e3p())):(tpc(txp())!=0?tpc(txp()):epc(e3p())))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):epc(e4p())):(tpc(txp())!=0?tpc(txp()):epc(e4p())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):epc(e2p()):tpc(txp())!=0?tpc(txp()):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):epc(e3p()):tpc(txp())!=0?tpc(txp()):epc(e3p()):ls1(epc(tev(e4p())))!=0?epc(e4p()):ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):epc(e4p()):tpc(txp())!=0?tpc(txp()):epc(e4p())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):ls4(v6=spp())!=0||(v7=txp())==0?(v8=spc(v6))!=0?v8:epc(v0):(v10=tpc(v7))!=0?v10:epc(v0):(v12=e2p())!=0?ls1(epc(tev(v12)))!=0?epc(v12):ls4(v18=spp())!=0||(v19=txp())==0?(v20=spc(v18))!=0?v20:epc(v12):(v22=tpc(v19))!=0?v22:epc(v12):(v24=e3p())!=0?ls1(epc(tev(v24)))!=0?epc(v24):ls4(v30=spp())!=0||(v31=txp())==0?(v32=spc(v30))!=0?v32:epc(v24):(v34=tpc(v31))!=0?v34:epc(v24):ls1(epc(tev(v39=e4p())))!=0?epc(v39):ls4(v42=spp())!=0||(v43=txp())==0?(v44=spc(v42))!=0?v44:epc(v39):(v46=tpc(v43))!=0?v46:epc(v39)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):ls4(q=spp())!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):ls4(q=spp())!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):ls4(q=spp())!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):ls1(epc(tev(p=e4p())))!=0?epc(p):ls4(q=spp())!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):(epc((p=e4p())&-2)&1)!=0?epc(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?cto(r):epo(p):(q=tpc(r))!=0?cto(q):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?cto(r):epo(p):(q=tpc(r))!=0?cto(q):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?cto(r):epo(p):(q=tpc(r))!=0?cto(q):epo(p):(epc((p=e4p())&-2)&1)!=0?epo(p):((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?cto(r):epo(p):(q=tpc(r))!=0?cto(q):epo(p)
  STE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //STE4_XWC

  //================================================================================
  //STE4_XWP ($0000,$06xx,$146F)
  //  概要
  //    STE4  スプライト＞テキスト＞512ドット16色4プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p()))))):(tpc(txp())!=0?tpc(txp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))))):e1p()==1?(ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):epc(0)):(tpc(txp())!=0?tpc(txp()):epc(0))):ls1(e1p())==0?(ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):epc(e1p())):(tpc(txp())!=0?tpc(txp()):epc(e1p()))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):tpc(txp())!=0?tpc(txp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):epc(0):tpc(txp())!=0?tpc(txp()):epc(0):ls1(e1p())==0?ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):epc(e1p()):tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?ls4(v2=spp())!=0||(v3=txp())==0?(v4=spc(v2))!=0?v4:(v5=tev(e2p()))!=0?epc(v5):(v8=tev(e3p()))!=0?epc(v8):epc(tev(e4p())):(v14=tpc(v3))!=0?v14:(v15=tev(e2p()))!=0?epc(v15):(v18=tev(e3p()))!=0?epc(v18):epc(tev(e4p())):v0==1?ls4(v25=spp())!=0||(v26=txp())==0?(v27=spc(v25))!=0?v27:epc(0):(v29=tpc(v26))!=0?v29:epc(0):ls1(v0)==0?ls4(v33=spp())!=0||(v34=txp())==0?(v35=spc(v33))!=0?v35:epc(v0):(v37=tpc(v34))!=0?v37:epc(v0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?ls4(p=spp())!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):(p=tpc(q))!=0?p:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?ls4(p=spp())!=0||(q=txp())==0?(q=spc(p))!=0?q:epc(0):(p=tpc(q))!=0?p:epc(0):ls1(p)==0?ls4(q=spp())!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):(p=tpc(q))!=0?p:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?q:epc(0):(p=tpc(q))!=0?p:epc(0):(p&1)==0?((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?r:epc(p):(q=tpc(r))!=0?q:epc(p):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):(p=tpc(q))!=0?cto(p):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?cto(q):epo(0):(p=tpc(q))!=0?cto(p):epo(0):(p&1)==0?((q=spp())&15)!=0||(r=txp())==0?(r=spc(q))!=0?cto(r):epo(p):(q=tpc(r))!=0?cto(q):epo(p):epo(p&-2)
  STE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            ((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            ((q = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (r = tp >>> 28) == 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[r]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (r = tp >>> 24 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (r = tp >>> 20 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (r = tp >>> 16 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (r = tp >>> 12 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (r = tp >>> 8 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (r = tp >>> 4 & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                ((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                ((q = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (r = tp & 15) == 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[r]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //STE4_XWP

  //================================================================================
  //STE4_XHCT ($0000,$06xx,$196F)
  //  概要
  //    STE4  スプライト＞テキスト＞512ドット16色4プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //  中間コード1
  //    (ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))):(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))))
  //  中間コード2
  //    ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()):tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())
  //  中間コード3
  //    ls4(v1=spp())!=0||(v2=txp())==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?ls1(epc(tev(v4)))!=0?mix(epc(v4),0):epc(v4):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?mix(epc(v11),0):epc(v11):(v18=e3p())!=0?ls1(epc(tev(v18)))!=0?mix(epc(v18),0):epc(v18):ls1(epc(tev(v28=e4p())))!=0?mix(epc(v28),0):epc(v28):(v32=tpc(v2))!=0?v32:(v33=e1p())!=0?ls1(epc(tev(v33)))!=0?mix(epc(v33),0):epc(v33):(v40=e2p())!=0?ls1(epc(tev(v40)))!=0?mix(epc(v40),0):epc(v40):(v47=e3p())!=0?ls1(epc(tev(v47)))!=0?mix(epc(v47),0):epc(v47):ls1(epc(tev(v57=e4p())))!=0?mix(epc(v57),0):epc(v57)
  //  中間コード4
  //    ls4(p=spp())!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p):(p=tpc(q))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    ((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=tpc(q))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    ((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=tpc(q))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  STE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //STE4_XHCT

  //================================================================================
  //STE4_XHCG ($0000,$06xx,$1A6F)
  //  概要
  //    STE4  スプライト＞テキスト＞512ドット16色4プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //  中間コード1
  //    (ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))))
  //  中間コード2
  //    ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p()):tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p())
  //  中間コード3
  //    ls4(v1=spp())!=0||(v2=txp())==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?ls1(v6=epc(tev(v4)))!=0?mix(v6,epc(tod(e2q()))):ls1(v4)!=0?epc(tod(e2q())):epc(v4):(v17=e2p())!=0?ls1(v19=epc(tev(v17)))!=0?mix(v19,epc(tod(e2q()))):epc(v17):(v26=e3p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(v28,epc(1)):ls1(v26)!=0?epc(1):epc(v26):ls1(v36=epc(tev(v38=e4p())))!=0?mix(v36,epc(1)):ls1(v38)!=0?epc(1):epc(v38):(v44=tpc(v2))!=0?v44:(v45=e1p())!=0?ls1(v47=epc(tev(v45)))!=0?mix(v47,epc(tod(e2q()))):ls1(v45)!=0?epc(tod(e2q())):epc(v45):(v58=e2p())!=0?ls1(v60=epc(tev(v58)))!=0?mix(v60,epc(tod(e2q()))):epc(v58):(v67=e3p())!=0?ls1(v69=epc(tev(v67)))!=0?mix(v69,epc(1)):ls1(v67)!=0?epc(1):epc(v67):ls1(v77=epc(tev(v79=e4p())))!=0?mix(v77,epc(1)):ls1(v79)!=0?epc(1):epc(v79)
  //  中間コード4
  //    ls4(p=spp())!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(p=tpc(q))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    ((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(p=tpc(q))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    ((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(p=tpc(q))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q)
  STE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //STE4_XHCG

  //================================================================================
  //STE4_XHCGT ($0000,$06xx,$1B6F)
  //  概要
  //    STE4  スプライト＞テキスト＞512ドット16色4プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    スプライトパレットの下位4bitが0でないまたはテキストパレットが0のとき
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(スプライトパレットの下位4bitが0かつテキストパレットが0でないとき)
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //  中間コード1
  //    (ls4(spp())!=0||txp()==0?(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))))
  //  中間コード2
  //    ls4(spp())!=0||txp()==0?spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p()):tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p())
  //  中間コード3
  //    ls4(v1=spp())!=0||(v2=txp())==0?(v3=spc(v1))!=0?v3:(v4=e1p())!=0?ls1(v6=epc(tev(v4)))!=0?mix(mix(v6,epc(tod(e2q()))),0):ls1(v4)!=0?epc(tod(e2q())):epc(v4):(v18=e2p())!=0?ls1(v20=epc(tev(v18)))!=0?mix(mix(v20,epc(tod(e2q()))),0):epc(v18):(v28=e3p())!=0?ls1(v30=epc(tev(v28)))!=0?mix(mix(v30,epc(1)),0):ls1(v28)!=0?epc(1):epc(v28):ls1(v39=epc(tev(v41=e4p())))!=0?mix(mix(v39,epc(1)),0):ls1(v41)!=0?epc(1):epc(v41):(v48=tpc(v2))!=0?v48:(v49=e1p())!=0?ls1(v51=epc(tev(v49)))!=0?mix(mix(v51,epc(tod(e2q()))),0):ls1(v49)!=0?epc(tod(e2q())):epc(v49):(v63=e2p())!=0?ls1(v65=epc(tev(v63)))!=0?mix(mix(v65,epc(tod(e2q()))),0):epc(v63):(v73=e3p())!=0?ls1(v75=epc(tev(v73)))!=0?mix(mix(v75,epc(1)),0):ls1(v73)!=0?epc(1):epc(v73):ls1(v84=epc(tev(v86=e4p())))!=0?mix(mix(v84,epc(1)),0):ls1(v86)!=0?epc(1):epc(v86)
  //  中間コード4
  //    ls4(p=spp())!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=tpc(q))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    ((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=tpc(q))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    ((p=spp())&15)!=0||(q=txp())==0?(q=spc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=tpc(q))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q)
  STE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = SpriteScreen.sprBuffer[sx]) & 15) != 0 || (q = tp >>> 28) == 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = (((p = SpriteScreen.sprBuffer[sx + 1]) & 15) != 0 || (q = tp >>> 24 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = (((p = SpriteScreen.sprBuffer[sx + 2]) & 15) != 0 || (q = tp >>> 20 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = (((p = SpriteScreen.sprBuffer[sx + 3]) & 15) != 0 || (q = tp >>> 16 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = (((p = SpriteScreen.sprBuffer[sx + 4]) & 15) != 0 || (q = tp >>> 12 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = (((p = SpriteScreen.sprBuffer[sx + 5]) & 15) != 0 || (q = tp >>> 8 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = (((p = SpriteScreen.sprBuffer[sx + 6]) & 15) != 0 || (q = tp >>> 4 & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = (((p = SpriteScreen.sprBuffer[sx + 7]) & 15) != 0 || (q = tp & 15) == 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //STE4_XHCGT

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

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

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

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

  //================================================================================
  //XSTF1
  //  概要
  //    STF1  スプライト＞テキスト＞512ドット256色1プレーン
  //    拡張あり
  XSTF1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //STF1_XWC
      case 0b00010001:  //STF1_XWC
      case 0b00010010:  //STF1_XWC
      case 0b00010011:  //STF1_XWC
        STF1_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //STF1_XWP
      case 0b00010101:  //STF1_XWP
      case 0b00010110:  //STF1_XWP
      case 0b00010111:  //STF1_XWP
        STF1_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //STF1_XHC
        STF1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //STF1_XHCT
        STF1_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //STF1_XHCG
        STF1_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //STF1_XHCGT
        STF1_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //STF1_XHPT
        STF1_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //STF1_XHPG
        STF1_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //STF1_XHPGT
        STF1_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //STF1_A
      case 0b01000001:  //STF1_A
      case 0b01000010:  //STF1_A
      case 0b01000011:  //STF1_A
      case 0b01000100:  //STF1_A
      case 0b01000101:  //STF1_A
      case 0b01000110:  //STF1_A
      case 0b01000111:  //STF1_A
      case 0b01001000:  //STF1_A
      case 0b01001001:  //STF1_A
      case 0b01001010:  //STF1_A
      case 0b01001011:  //STF1_A
      case 0b01001100:  //STF1_A
      case 0b01001101:  //STF1_A
      case 0b01001110:  //STF1_A
      case 0b01001111:  //STF1_A
      case 0b01010000:  //STF1_A
      case 0b01010001:  //STF1_A
      case 0b01010010:  //STF1_A
      case 0b01010011:  //STF1_A
      case 0b01010100:  //STF1_A
      case 0b01010101:  //STF1_A
      case 0b01010110:  //STF1_A
      case 0b01010111:  //STF1_A
      case 0b01011000:  //STF1_A
      case 0b01011001:  //STF1_A
      case 0b01011010:  //STF1_A
      case 0b01011011:  //STF1_A
      case 0b01011100:  //STF1_A
      case 0b01011101:  //STF1_A
      case 0b01011110:  //STF1_A
      case 0b01011111:  //STF1_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        STF1.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSTF1);
      }  //switch
    }  //drawRaster
  },  //XSTF1

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XSTF2
  //  概要
  //    STF2  スプライト＞テキスト＞512ドット256色2プレーン
  //    拡張あり
  XSTF2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //STF2_XWC
      case 0b00010001:  //STF2_XWC
      case 0b00010010:  //STF2_XWC
      case 0b00010011:  //STF2_XWC
        STF2_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //STF2_XWP
      case 0b00010101:  //STF2_XWP
      case 0b00010110:  //STF2_XWP
      case 0b00010111:  //STF2_XWP
        STF2_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //STF2_XHC
        STF2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //STF2_XHCT
        STF2_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //STF2_XHCG
        STF2_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //STF2_XHCGT
        STF2_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //STF2_XHPT
        STF2_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //STF2_XHPG
        STF2_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //STF2_XHPGT
        STF2_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //STF2_A
      case 0b01000001:  //STF2_A
      case 0b01000010:  //STF2_A
      case 0b01000011:  //STF2_A
      case 0b01000100:  //STF2_A
      case 0b01000101:  //STF2_A
      case 0b01000110:  //STF2_A
      case 0b01000111:  //STF2_A
      case 0b01001000:  //STF2_A
      case 0b01001001:  //STF2_A
      case 0b01001010:  //STF2_A
      case 0b01001011:  //STF2_A
      case 0b01001100:  //STF2_A
      case 0b01001101:  //STF2_A
      case 0b01001110:  //STF2_A
      case 0b01001111:  //STF2_A
      case 0b01010000:  //STF2_A
      case 0b01010001:  //STF2_A
      case 0b01010010:  //STF2_A
      case 0b01010011:  //STF2_A
      case 0b01010100:  //STF2_A
      case 0b01010101:  //STF2_A
      case 0b01010110:  //STF2_A
      case 0b01010111:  //STF2_A
      case 0b01011000:  //STF2_A
      case 0b01011001:  //STF2_A
      case 0b01011010:  //STF2_A
      case 0b01011011:  //STF2_A
      case 0b01011100:  //STF2_A
      case 0b01011101:  //STF2_A
      case 0b01011110:  //STF2_A
      case 0b01011111:  //STF2_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        STF2.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XSTF2);
      }  //switch
    }  //drawRaster
  },  //XSTF2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XE1TS
  //  概要
  //    E1TS  512ドット16色1プレーン＞テキスト＞スプライト
  //    拡張あり
  XE1TS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E1TS_XWC
      case 0b00010001:  //E1TS_XWC
      case 0b00010010:  //E1TS_XWC
      case 0b00010011:  //E1TS_XWC
        E1TS_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E1TS_XWP
      case 0b00010101:  //E1TS_XWP
      case 0b00010110:  //E1TS_XWP
      case 0b00010111:  //E1TS_XWP
        E1TS_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E1TS_XHC
        E1TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E1TS_XHCT
        E1TS_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E1TS_XHCG
        E1TS_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E1TS_XHCGT
        E1TS_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E1TS_XHPT
        E1TS_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E1TS_XHPG
        E1TS_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E1TS_XHPGT
        E1TS_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E1TS_A
      case 0b01000001:  //E1TS_A
      case 0b01000010:  //E1TS_A
      case 0b01000011:  //E1TS_A
      case 0b01000100:  //E1TS_A
      case 0b01000101:  //E1TS_A
      case 0b01000110:  //E1TS_A
      case 0b01000111:  //E1TS_A
      case 0b01001000:  //E1TS_A
      case 0b01001001:  //E1TS_A
      case 0b01001010:  //E1TS_A
      case 0b01001011:  //E1TS_A
      case 0b01001100:  //E1TS_A
      case 0b01001101:  //E1TS_A
      case 0b01001110:  //E1TS_A
      case 0b01001111:  //E1TS_A
      case 0b01010000:  //E1TS_A
      case 0b01010001:  //E1TS_A
      case 0b01010010:  //E1TS_A
      case 0b01010011:  //E1TS_A
      case 0b01010100:  //E1TS_A
      case 0b01010101:  //E1TS_A
      case 0b01010110:  //E1TS_A
      case 0b01010111:  //E1TS_A
      case 0b01011000:  //E1TS_A
      case 0b01011001:  //E1TS_A
      case 0b01011010:  //E1TS_A
      case 0b01011011:  //E1TS_A
      case 0b01011100:  //E1TS_A
      case 0b01011101:  //E1TS_A
      case 0b01011110:  //E1TS_A
      case 0b01011111:  //E1TS_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        E1TS.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE1TS);
      }  //switch
    }  //drawRaster
  },  //XE1TS

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

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

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

  //================================================================================
  //E1TS_XHCG ($0000,$24xx,$1A61)
  //  概要
  //    E1TS  512ドット16色1プレーン＞テキスト＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp())))))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(v1,epc(tod(e2q()))):ls1(v3)!=0?(v9=epc(tod(e2q())))!=0?v9:(v12=txp())!=0?tpc(v12):spc(spp()):(v16=epc(v3))!=0?v16:(v17=txp())!=0?tpc(v17):spc(spp())
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E1TS_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1TS_XHCG

  //================================================================================
  //E1TS_XHCGT ($0000,$24xx,$1B61)
  //  概要
  //    E1TS  512ドット16色1プレーン＞テキスト＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp())))))
  //  中間コード2
  //    ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    ls1(v1=epc(tev(v3=e1p())))!=0?mix(mix(v1,epc(tod(e2q()))),(v9=txp())!=0?tpc(v9):spc(spp())):ls1(v3)!=0?(v14=epc(tod(e2q())))!=0?v14:(v17=txp())!=0?tpc(v17):spc(spp()):(v21=epc(v3))!=0?v21:(v22=txp())!=0?tpc(v22):spc(spp())
  //  中間コード4
  //    ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp())):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    ((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(q&1)!=0?(p=epc(e2q()|1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    ((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E1TS_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = (((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E1TS_XHCGT

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

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

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

  //================================================================================
  //E2TS ($0000,$24xx,$0063)
  //  概要
  //    E2TS  512ドット16色2プレーン＞テキスト＞スプライト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のカラーが0でないとき
  //        2番目のカラー
  //      さもなくば(2番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:(v2=txp())!=0?tpc(v2):spc(spp()):(v6=epc(e2p()))!=0?v6:(v8=txp())!=0?tpc(v8):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e2p()))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e2p()))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(e2p()))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E2TS {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2TS

  //================================================================================
  //XE2TS
  //  概要
  //    E2TS  512ドット16色2プレーン＞テキスト＞スプライト
  //    拡張あり
  XE2TS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E2TS_XWC
      case 0b00010001:  //E2TS_XWC
      case 0b00010010:  //E2TS_XWC
      case 0b00010011:  //E2TS_XWC
        E2TS_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E2TS_XWP
      case 0b00010101:  //E2TS_XWP
      case 0b00010110:  //E2TS_XWP
      case 0b00010111:  //E2TS_XWP
        E2TS_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E2TS_XHC
        E2TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E2TS_XHCT
        E2TS_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E2TS_XHCG
        E2TS_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E2TS_XHCGT
        E2TS_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E2TS_XHPT
        E2TS_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E2TS_XHPG
        E2TS_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E2TS_XHPGT
        E2TS_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E2TS_A
      case 0b01000001:  //E2TS_A
      case 0b01000010:  //E2TS_A
      case 0b01000011:  //E2TS_A
      case 0b01000100:  //E2TS_A
      case 0b01000101:  //E2TS_A
      case 0b01000110:  //E2TS_A
      case 0b01000111:  //E2TS_A
      case 0b01001000:  //E2TS_A
      case 0b01001001:  //E2TS_A
      case 0b01001010:  //E2TS_A
      case 0b01001011:  //E2TS_A
      case 0b01001100:  //E2TS_A
      case 0b01001101:  //E2TS_A
      case 0b01001110:  //E2TS_A
      case 0b01001111:  //E2TS_A
      case 0b01010000:  //E2TS_A
      case 0b01010001:  //E2TS_A
      case 0b01010010:  //E2TS_A
      case 0b01010011:  //E2TS_A
      case 0b01010100:  //E2TS_A
      case 0b01010101:  //E2TS_A
      case 0b01010110:  //E2TS_A
      case 0b01010111:  //E2TS_A
      case 0b01011000:  //E2TS_A
      case 0b01011001:  //E2TS_A
      case 0b01011010:  //E2TS_A
      case 0b01011011:  //E2TS_A
      case 0b01011100:  //E2TS_A
      case 0b01011101:  //E2TS_A
      case 0b01011110:  //E2TS_A
      case 0b01011111:  //E2TS_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        E2TS.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE2TS);
      }  //switch
    }  //drawRaster
  },  //XE2TS

  //================================================================================
  //E2TS_XWC ($0000,$24xx,$1063)
  //  概要
  //    E2TS  512ドット16色2プレーン＞テキスト＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:(v6=txp())!=0?tpc(v6):spc(spp()):ls1(epc(tev(v13=e2p())))!=0?epc(v13):(v15=epc(v13))!=0?v15:(v16=txp())!=0?tpc(v16):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(epc(tev(p=e2p())))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(epc((p=e2p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  E2TS_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2TS_XWC

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

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

  //================================================================================
  //E2TS_XHCG ($0000,$24xx,$1A63)
  //  概要
  //    E2TS  512ドット16色2プレーン＞テキスト＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが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())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):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())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):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:(v12=txp())!=0?tpc(v12):spc(spp()):(v16=epc(v0))!=0?v16:(v17=txp())!=0?tpc(v17):spc(spp()):ls1(v22=epc(tev(v24=e2p())))!=0?mix(v22,epc(tod(e2q()))):(v29=epc(v24))!=0?v29:(v30=txp())!=0?tpc(v30):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:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):(p=epc(q))!=0?p:(p=txp())!=0?tpc(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:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(p=epc(q))!=0?p:(p=txp())!=0?tpc(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):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E2TS_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2TS_XHCG

  //================================================================================
  //E2TS_XHCGT ($0000,$24xx,$1B63)
  //  概要
  //    E2TS  512ドット16色2プレーン＞テキスト＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp())):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),(v9=txp())!=0?tpc(v9):spc(spp())):ls1(v0)!=0?(v14=epc(tod(e2q())))!=0?v14:(v17=txp())!=0?tpc(v17):spc(spp()):(v21=epc(v0))!=0?v21:(v22=txp())!=0?tpc(v22):spc(spp()):ls1(v27=epc(tev(v29=e2p())))!=0?mix(mix(v27,epc(tod(e2q()))),(v35=txp())!=0?tpc(v35):spc(spp())):(v39=epc(v29))!=0?v39:(v40=txp())!=0?tpc(v40):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp())):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E2TS_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2TS_XHCGT

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

  //================================================================================
  //E2TS_XHPG ($0000,$24xx,$1E63)
  //  概要
  //    E2TS  512ドット16色2プレーン＞テキスト＞スプライト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(txp()!=0?tpc(txp()):spc(spp()))):e1p()==1?(epc(0)!=0?epc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):(mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):txp()!=0?tpc(txp()):spc(spp()):e1p()==1?epc(0)!=0?epc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:(v4=txp())!=0?tpc(v4):spc(spp()):v0==1?(v8=epc(0))!=0?v8:(v9=txp())!=0?tpc(v9):spc(spp()):ls1(v0)==0?(v14=epc(v0))!=0?v14:(v15=txp())!=0?tpc(v15):spc(spp()):(v19=mix(epc(tev(v0)),epc(tod(e2p()))))!=0?v19:(v25=txp())!=0?tpc(v25):spc(spp())
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(q=mix(epc(tev(p)),epc(tod(e2p()))))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  E2TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2TS_XHPG

  //================================================================================
  //E2TS_XHPGT ($0000,$24xx,$1F63)
  //  概要
  //    E2TS  512ドット16色2プレーン＞テキスト＞スプライト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(txp()!=0?tpc(txp()):spc(spp()))):e1p()==1?(epc(0)!=0?epc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):txp()!=0?tpc(txp()):spc(spp()):e1p()==1?epc(0)!=0?epc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),txp()!=0?tpc(txp()):spc(spp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=epc(tev(e2p())))!=0?v1:(v4=txp())!=0?tpc(v4):spc(spp()):v0==1?(v8=epc(0))!=0?v8:(v9=txp())!=0?tpc(v9):spc(spp()):ls1(v0)==0?(v14=epc(v0))!=0?v14:(v15=txp())!=0?tpc(v15):spc(spp()):mix(mix(epc(tev(v0)),epc(tod(e2p()))),(v26=txp())!=0?tpc(v26):spc(spp()))
  //  中間コード4
  //    (p=e1p())==0?(p=epc(tev(e2p())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):mix(mix(epc(tev(p)),epc(tod(e2p()))),(p=txp())!=0?tpc(p):spc(spp()))
  //  中間コード5
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):mix(mix(epc(p&-2),epc(e2p()|1)),(p=txp())!=0?tpc(p):spc(spp()))
  //  中間コード6
  //    (p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):cto(mix(mix(epc(p&-2),epc(e2p()|1)),(p=txp())!=0?tpc(p):spc(spp())))
  E2TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E2TS_XHPGT

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

  //================================================================================
  //XE3TS
  //  概要
  //    E3TS  512ドット16色3プレーン＞テキスト＞スプライト
  //    拡張あり
  XE3TS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E3TS_XWC
      case 0b00010001:  //E3TS_XWC
      case 0b00010010:  //E3TS_XWC
      case 0b00010011:  //E3TS_XWC
        E3TS_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E3TS_XWP
      case 0b00010101:  //E3TS_XWP
      case 0b00010110:  //E3TS_XWP
      case 0b00010111:  //E3TS_XWP
        E3TS_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E3TS_XHC
        E3TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E3TS_XHCT
        E3TS_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E3TS_XHCG
        E3TS_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E3TS_XHCGT
        E3TS_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E3TS_XHPT
        E3TS_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E3TS_XHPG
        E3TS_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E3TS_XHPGT
        E3TS_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E3TS_A
      case 0b01000001:  //E3TS_A
      case 0b01000010:  //E3TS_A
      case 0b01000011:  //E3TS_A
      case 0b01000100:  //E3TS_A
      case 0b01000101:  //E3TS_A
      case 0b01000110:  //E3TS_A
      case 0b01000111:  //E3TS_A
      case 0b01001000:  //E3TS_A
      case 0b01001001:  //E3TS_A
      case 0b01001010:  //E3TS_A
      case 0b01001011:  //E3TS_A
      case 0b01001100:  //E3TS_A
      case 0b01001101:  //E3TS_A
      case 0b01001110:  //E3TS_A
      case 0b01001111:  //E3TS_A
      case 0b01010000:  //E3TS_A
      case 0b01010001:  //E3TS_A
      case 0b01010010:  //E3TS_A
      case 0b01010011:  //E3TS_A
      case 0b01010100:  //E3TS_A
      case 0b01010101:  //E3TS_A
      case 0b01010110:  //E3TS_A
      case 0b01010111:  //E3TS_A
      case 0b01011000:  //E3TS_A
      case 0b01011001:  //E3TS_A
      case 0b01011010:  //E3TS_A
      case 0b01011011:  //E3TS_A
      case 0b01011100:  //E3TS_A
      case 0b01011101:  //E3TS_A
      case 0b01011110:  //E3TS_A
      case 0b01011111:  //E3TS_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        E3TS.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE3TS);
      }  //switch
    }  //drawRaster
  },  //XE3TS

  //================================================================================
  //E3TS_XWC ($0000,$24xx,$1067)
  //  概要
  //    E3TS  512ドット16色3プレーン＞テキスト＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):spc(spp()))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e3p())))!=0?epc(e3p()):epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:(v6=txp())!=0?tpc(v6):spc(spp()):(v10=e2p())!=0?ls1(epc(tev(v10)))!=0?epc(v10):(v15=epc(v10))!=0?v15:(v16=txp())!=0?tpc(v16):spc(spp()):ls1(epc(tev(v23=e3p())))!=0?epc(v23):(v25=epc(v23))!=0?v25:(v26=txp())!=0?tpc(v26):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(epc(tev(p=e3p())))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(epc((p=e3p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  E3TS_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3TS_XWC

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

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

  //================================================================================
  //E3TS_XHCG ($0000,$24xx,$1A67)
  //  概要
  //    E3TS  512ドット16色3プレーン＞テキスト＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが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())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):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())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):txp()!=0?tpc(txp()):spc(spp()):epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):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:(v12=txp())!=0?tpc(v12):spc(spp()):(v16=epc(v0))!=0?v16:(v17=txp())!=0?tpc(v17):spc(spp()):(v21=e2p())!=0?ls1(v23=epc(tev(v21)))!=0?mix(v23,epc(tod(e2q()))):(v29=epc(v21))!=0?v29:(v30=txp())!=0?tpc(v30):spc(spp()):ls1(v35=epc(tev(v37=e3p())))!=0?mix(v35,epc(1)):ls1(v37)!=0?(v41=epc(1))!=0?v41:(v42=txp())!=0?tpc(v42):spc(spp()):(v46=epc(v37))!=0?v46:(v47=txp())!=0?tpc(v47):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:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(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:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(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):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E3TS_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3TS_XHCG

  //================================================================================
  //E3TS_XHCGT ($0000,$24xx,$1B67)
  //  概要
  //    E3TS  512ドット16色3プレーン＞テキスト＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          3番目のパレットが奇数のとき
  //            パレット1のカラーが0でないとき
  //              パレット1のカラー
  //            さもなくば(パレット1のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //          さもなくば(3番目のパレットが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):spc(spp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp())):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),txp()!=0?tpc(txp()):spc(spp())):ls1(e3p())!=0?epc(1)!=0?epc(1):txp()!=0?tpc(txp()):spc(spp()):epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),(v9=txp())!=0?tpc(v9):spc(spp())):ls1(v0)!=0?(v14=epc(tod(e2q())))!=0?v14:(v17=txp())!=0?tpc(v17):spc(spp()):(v21=epc(v0))!=0?v21:(v22=txp())!=0?tpc(v22):spc(spp()):(v26=e2p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(tod(e2q()))),(v35=txp())!=0?tpc(v35):spc(spp())):(v39=epc(v26))!=0?v39:(v40=txp())!=0?tpc(v40):spc(spp()):ls1(v45=epc(tev(v47=e3p())))!=0?mix(mix(v45,epc(1)),(v51=txp())!=0?tpc(v51):spc(spp())):ls1(v47)!=0?(v56=epc(1))!=0?v56:(v57=txp())!=0?tpc(v57):spc(spp()):(v61=epc(v47))!=0?v61:(v62=txp())!=0?tpc(v62):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),(p=txp())!=0?tpc(p):spc(spp())):ls1(q)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),(p=txp())!=0?tpc(p):spc(spp())):(q&1)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),(p=txp())!=0?tpc(p):spc(spp()))):(q&1)!=0?(p=epc(1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E3TS_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E3TS_XHCGT

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

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

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

  //================================================================================
  //E4TS ($0000,$24xx,$006F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    拡張なし
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のカラーが0でないとき
  //            4番目のカラー
  //          さもなくば(4番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp()))):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e4p())!=0?epc(e4p()):(txp()!=0?tpc(txp()):spc(spp()))))))
  //  中間コード2
  //    e1p()!=0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):e3p()!=0?epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):spc(spp()):epc(e4p())!=0?epc(e4p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?(v1=epc(v0))!=0?v1:(v2=txp())!=0?tpc(v2):spc(spp()):(v6=e2p())!=0?(v7=epc(v6))!=0?v7:(v8=txp())!=0?tpc(v8):spc(spp()):(v12=e3p())!=0?(v13=epc(v12))!=0?v13:(v14=txp())!=0?tpc(v14):spc(spp()):(v18=epc(e4p()))!=0?v18:(v20=txp())!=0?tpc(v20):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e4p()))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e4p()))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p())!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(e4p()))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E4TS {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS

  //================================================================================
  //XE4TS
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    拡張あり
  XE4TS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //E4TS_XWC
      case 0b00010001:  //E4TS_XWC
      case 0b00010010:  //E4TS_XWC
      case 0b00010011:  //E4TS_XWC
        E4TS_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //E4TS_XWP
      case 0b00010101:  //E4TS_XWP
      case 0b00010110:  //E4TS_XWP
      case 0b00010111:  //E4TS_XWP
        E4TS_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //E4TS_XHC
        E4TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //E4TS_XHCT
        E4TS_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //E4TS_XHCG
        E4TS_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //E4TS_XHCGT
        E4TS_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //E4TS_XHPT
        E4TS_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //E4TS_XHPG
        E4TS_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //E4TS_XHPGT
        E4TS_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //E4TS_A
      case 0b01000001:  //E4TS_A
      case 0b01000010:  //E4TS_A
      case 0b01000011:  //E4TS_A
      case 0b01000100:  //E4TS_A
      case 0b01000101:  //E4TS_A
      case 0b01000110:  //E4TS_A
      case 0b01000111:  //E4TS_A
      case 0b01001000:  //E4TS_A
      case 0b01001001:  //E4TS_A
      case 0b01001010:  //E4TS_A
      case 0b01001011:  //E4TS_A
      case 0b01001100:  //E4TS_A
      case 0b01001101:  //E4TS_A
      case 0b01001110:  //E4TS_A
      case 0b01001111:  //E4TS_A
      case 0b01010000:  //E4TS_A
      case 0b01010001:  //E4TS_A
      case 0b01010010:  //E4TS_A
      case 0b01010011:  //E4TS_A
      case 0b01010100:  //E4TS_A
      case 0b01010101:  //E4TS_A
      case 0b01010110:  //E4TS_A
      case 0b01010111:  //E4TS_A
      case 0b01011000:  //E4TS_A
      case 0b01011001:  //E4TS_A
      case 0b01011010:  //E4TS_A
      case 0b01011011:  //E4TS_A
      case 0b01011100:  //E4TS_A
      case 0b01011101:  //E4TS_A
      case 0b01011110:  //E4TS_A
      case 0b01011111:  //E4TS_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        E4TS.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XE4TS);
      }  //switch
    }  //drawRaster
  },  //XE4TS

  //================================================================================
  //E4TS_XWC ($0000,$24xx,$106F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のカラーが0でないとき
  //              4番目のカラー
  //            さもなくば(4番目のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(epc(e4p())!=0?epc(e4p()):(txp()!=0?tpc(txp()):spc(spp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e4p())))!=0?epc(e4p()):epc(e4p())!=0?epc(e4p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=epc(v0))!=0?v5:(v6=txp())!=0?tpc(v6):spc(spp()):(v10=e2p())!=0?ls1(epc(tev(v10)))!=0?epc(v10):(v15=epc(v10))!=0?v15:(v16=txp())!=0?tpc(v16):spc(spp()):(v20=e3p())!=0?ls1(epc(tev(v20)))!=0?epc(v20):(v25=epc(v20))!=0?v25:(v26=txp())!=0?tpc(v26):spc(spp()):ls1(epc(tev(v33=e4p())))!=0?epc(v33):(v35=epc(v33))!=0?v35:(v36=txp())!=0?tpc(v36):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XWC

  //================================================================================
  //E4TS_XWP ($0000,$24xx,$146F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(txp()!=0?tpc(txp()):spc(spp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(txp()!=0?tpc(txp()):spc(spp()))))):e1p()==1?(epc(0)!=0?epc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):txp()!=0?tpc(txp()):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):txp()!=0?tpc(txp()):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):txp()!=0?tpc(txp()):spc(spp()):e1p()==1?epc(0)!=0?epc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:(v4=txp())!=0?tpc(v4):spc(spp()):(v8=tev(e3p()))!=0?(v10=epc(v8))!=0?v10:(v11=txp())!=0?tpc(v11):spc(spp()):(v15=epc(tev(e4p())))!=0?v15:(v18=txp())!=0?tpc(v18):spc(spp()):v0==1?(v22=epc(0))!=0?v22:(v23=txp())!=0?tpc(v23):spc(spp()):ls1(v0)==0?(v28=epc(v0))!=0?v28:(v29=txp())!=0?tpc(v29):spc(spp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(tev(e4p())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e4p()&-2))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):epo(p&-2)
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XWP

  //================================================================================
  //E4TS_XHCT ($0000,$24xx,$196F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーと
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラーと
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラーと
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のカラーが0でないとき
  //              4番目のカラー
  //            さもなくば(4番目のカラーが0のとき)
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),(txp()!=0?tpc(txp()):spc(spp()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),(txp()!=0?tpc(txp()):spc(spp()))):(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),(txp()!=0?tpc(txp()):spc(spp()))):(epc(e4p())!=0?epc(e4p()):(txp()!=0?tpc(txp()):spc(spp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),txp()!=0?tpc(txp()):spc(spp())):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),txp()!=0?tpc(txp()):spc(spp())):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),txp()!=0?tpc(txp()):spc(spp())):epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),txp()!=0?tpc(txp()):spc(spp())):epc(e4p())!=0?epc(e4p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?mix(epc(v0),(v6=txp())!=0?tpc(v6):spc(spp())):(v10=epc(v0))!=0?v10:(v11=txp())!=0?tpc(v11):spc(spp()):(v15=e2p())!=0?ls1(epc(tev(v15)))!=0?mix(epc(v15),(v21=txp())!=0?tpc(v21):spc(spp())):(v25=epc(v15))!=0?v25:(v26=txp())!=0?tpc(v26):spc(spp()):(v30=e3p())!=0?ls1(epc(tev(v30)))!=0?mix(epc(v30),(v36=txp())!=0?tpc(v36):spc(spp())):(v40=epc(v30))!=0?v40:(v41=txp())!=0?tpc(v41):spc(spp()):ls1(epc(tev(v48=e4p())))!=0?mix(epc(v48),(v51=txp())!=0?tpc(v51):spc(spp())):(v55=epc(v48))!=0?v55:(v56=txp())!=0?tpc(v56):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),(p=txp())!=0?tpc(p):spc(spp()))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),(p=txp())!=0?tpc(p):spc(spp()))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),(p=txp())!=0?tpc(p):spc(spp()))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),(p=txp())!=0?tpc(p):spc(spp()))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XHCT

  //================================================================================
  //E4TS_XHCG ($0000,$24xx,$1A6F)
  //  概要
  //    E4TS  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でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが0のとき)
  //                  スプライトカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが0のとき)
  //                  スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが0のとき)
  //                  スプライトカラー(0は黒)
  //            さもなくば(4番目のパレットが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが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())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):spc(spp()))))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e4p())!=0?epc(e4p()):(txp()!=0?tpc(txp()):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())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):txp()!=0?tpc(txp()):spc(spp()):epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):txp()!=0?tpc(txp()):spc(spp()):epc(e4p())!=0?epc(e4p()):txp()!=0?tpc(txp()):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:(v12=txp())!=0?tpc(v12):spc(spp()):(v16=epc(v0))!=0?v16:(v17=txp())!=0?tpc(v17):spc(spp()):(v21=e2p())!=0?ls1(v23=epc(tev(v21)))!=0?mix(v23,epc(tod(e2q()))):(v29=epc(v21))!=0?v29:(v30=txp())!=0?tpc(v30):spc(spp()):(v34=e3p())!=0?ls1(v36=epc(tev(v34)))!=0?mix(v36,epc(1)):ls1(v34)!=0?(v41=epc(1))!=0?v41:(v42=txp())!=0?tpc(v42):spc(spp()):(v46=epc(v34))!=0?v46:(v47=txp())!=0?tpc(v47):spc(spp()):ls1(v52=epc(tev(v54=e4p())))!=0?mix(v52,epc(1)):ls1(v54)!=0?(v58=epc(1))!=0?v58:(v59=txp())!=0?tpc(v59):spc(spp()):(v63=epc(v54))!=0?v63:(v64=txp())!=0?tpc(v64):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:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(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:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(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):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):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):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XHCG

  //================================================================================
  //E4TS_XHCGT ($0000,$24xx,$1B6F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが0のとき)
  //                  スプライトカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが0のとき)
  //                  スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              テキストパレットが0でないとき
  //                テキストカラー(0は黒)
  //              さもなくば(テキストパレットが0のとき)
  //                スプライトカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            4番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが0のとき)
  //                  スプライトカラー(0は黒)
  //            さもなくば(4番目のパレットが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                テキストパレットが0でないとき
  //                  テキストカラー(0は黒)
  //                さもなくば(テキストパレットが0のとき)
  //                  スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(epc(e2p())!=0?epc(e2p()):(txp()!=0?tpc(txp()):spc(spp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(e3p())!=0?(epc(1)!=0?epc(1):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e3p())!=0?epc(e3p()):(txp()!=0?tpc(txp()):spc(spp()))))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(e4p())!=0?(epc(1)!=0?epc(1):(txp()!=0?tpc(txp()):spc(spp()))):(epc(e4p())!=0?epc(e4p()):(txp()!=0?tpc(txp()):spc(spp()))))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp())):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):txp()!=0?tpc(txp()):spc(spp()):epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp())):epc(e2p())!=0?epc(e2p()):txp()!=0?tpc(txp()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),txp()!=0?tpc(txp()):spc(spp())):ls1(e3p())!=0?epc(1)!=0?epc(1):txp()!=0?tpc(txp()):spc(spp()):epc(e3p())!=0?epc(e3p()):txp()!=0?tpc(txp()):spc(spp()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),txp()!=0?tpc(txp()):spc(spp())):ls1(e4p())!=0?epc(1)!=0?epc(1):txp()!=0?tpc(txp()):spc(spp()):epc(e4p())!=0?epc(e4p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(v2=epc(tev(v0)))!=0?mix(mix(v2,epc(tod(e2q()))),(v9=txp())!=0?tpc(v9):spc(spp())):ls1(v0)!=0?(v14=epc(tod(e2q())))!=0?v14:(v17=txp())!=0?tpc(v17):spc(spp()):(v21=epc(v0))!=0?v21:(v22=txp())!=0?tpc(v22):spc(spp()):(v26=e2p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(tod(e2q()))),(v35=txp())!=0?tpc(v35):spc(spp())):(v39=epc(v26))!=0?v39:(v40=txp())!=0?tpc(v40):spc(spp()):(v44=e3p())!=0?ls1(v46=epc(tev(v44)))!=0?mix(mix(v46,epc(1)),(v51=txp())!=0?tpc(v51):spc(spp())):ls1(v44)!=0?(v56=epc(1))!=0?v56:(v57=txp())!=0?tpc(v57):spc(spp()):(v61=epc(v44))!=0?v61:(v62=txp())!=0?tpc(v62):spc(spp()):ls1(v67=epc(tev(v69=e4p())))!=0?mix(mix(v67,epc(1)),(v73=txp())!=0?tpc(v73):spc(spp())):ls1(v69)!=0?(v78=epc(1))!=0?v78:(v79=txp())!=0?tpc(v79):spc(spp()):(v83=epc(v69))!=0?v83:(v84=txp())!=0?tpc(v84):spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp())):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),(p=txp())!=0?tpc(p):spc(spp())):ls1(p)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),(p=txp())!=0?tpc(p):spc(spp())):ls1(q)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(p&1)!=0?(p=epc(e2q()|1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),(p=txp())!=0?tpc(p):spc(spp())):(p&1)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),(p=txp())!=0?tpc(p):spc(spp())):(q&1)!=0?(p=epc(1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),(p=txp())!=0?tpc(p):spc(spp()))):(p&1)!=0?(p=epc(1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),(p=txp())!=0?tpc(p):spc(spp()))):(q&1)!=0?(p=epc(1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = 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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XHCGT

  //================================================================================
  //E4TS_XHPT ($0000,$24xx,$1D6F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(txp()!=0?tpc(txp()):spc(spp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(txp()!=0?tpc(txp()):spc(spp()))))):e1p()==1?(epc(0)!=0?epc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):mix(epc(tev(e1p())),(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):txp()!=0?tpc(txp()):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):txp()!=0?tpc(txp()):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):txp()!=0?tpc(txp()):spc(spp()):e1p()==1?epc(0)!=0?epc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):mix(epc(tev(e1p())),txp()!=0?tpc(txp()):spc(spp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:(v4=txp())!=0?tpc(v4):spc(spp()):(v8=tev(e3p()))!=0?(v10=epc(v8))!=0?v10:(v11=txp())!=0?tpc(v11):spc(spp()):(v15=epc(tev(e4p())))!=0?v15:(v18=txp())!=0?tpc(v18):spc(spp()):v0==1?(v22=epc(0))!=0?v22:(v23=txp())!=0?tpc(v23):spc(spp()):ls1(v0)==0?(v28=epc(v0))!=0?v28:(v29=txp())!=0?tpc(v29):spc(spp()):mix(epc(tev(v0)),(v36=txp())!=0?tpc(v36):spc(spp()))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(tev(e4p())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):mix(epc(tev(p)),(p=txp())!=0?tpc(p):spc(spp()))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e4p()&-2))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):mix(epc(p&-2),(p=txp())!=0?tpc(p):spc(spp()))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):cto(mix(epc(p&-2),(p=txp())!=0?tpc(p):spc(spp())))
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XHPT

  //================================================================================
  //E4TS_XHPG ($0000,$24xx,$1E6F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(txp()!=0?tpc(txp()):spc(spp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(txp()!=0?tpc(txp()):spc(spp()))))):e1p()==1?(epc(0)!=0?epc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):txp()!=0?tpc(txp()):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):txp()!=0?tpc(txp()):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):txp()!=0?tpc(txp()):spc(spp()):e1p()==1?epc(0)!=0?epc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:(v4=txp())!=0?tpc(v4):spc(spp()):(v8=tev(e3p()))!=0?(v10=epc(v8))!=0?v10:(v11=txp())!=0?tpc(v11):spc(spp()):(v15=epc(tev(e4p())))!=0?v15:(v18=txp())!=0?tpc(v18):spc(spp()):v0==1?(v22=epc(0))!=0?v22:(v23=txp())!=0?tpc(v23):spc(spp()):ls1(v0)==0?(v28=epc(v0))!=0?v28:(v29=txp())!=0?tpc(v29):spc(spp()):(v33=mix(epc(tev(v0)),epc(tod(e2q()))))!=0?v33:(v39=txp())!=0?tpc(v39):spc(spp())
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(tev(e4p())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e4p()&-2))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XHPG

  //================================================================================
  //E4TS_XHPGT ($0000,$24xx,$1F6F)
  //  概要
  //    E4TS  512ドット16色4プレーン＞テキスト＞スプライト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //        3番目のパレットを偶数化したパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが0でないとき
  //            4番目のパレットを偶数化したパレットのカラー
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):(txp()!=0?tpc(txp()):spc(spp()))):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):(txp()!=0?tpc(txp()):spc(spp()))):(epc(tev(e4p()))!=0?epc(tev(e4p())):(txp()!=0?tpc(txp()):spc(spp()))))):e1p()==1?(epc(0)!=0?epc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):(txp()!=0?tpc(txp()):spc(spp()))):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):txp()!=0?tpc(txp()):spc(spp()):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):txp()!=0?tpc(txp()):spc(spp()):epc(tev(e4p()))!=0?epc(tev(e4p())):txp()!=0?tpc(txp()):spc(spp()):e1p()==1?epc(0)!=0?epc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):txp()!=0?tpc(txp()):spc(spp()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),txp()!=0?tpc(txp()):spc(spp()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=tev(e2p()))!=0?(v3=epc(v1))!=0?v3:(v4=txp())!=0?tpc(v4):spc(spp()):(v8=tev(e3p()))!=0?(v10=epc(v8))!=0?v10:(v11=txp())!=0?tpc(v11):spc(spp()):(v15=epc(tev(e4p())))!=0?v15:(v18=txp())!=0?tpc(v18):spc(spp()):v0==1?(v22=epc(0))!=0?v22:(v23=txp())!=0?tpc(v23):spc(spp()):ls1(v0)==0?(v28=epc(v0))!=0?v28:(v29=txp())!=0?tpc(v29):spc(spp()):mix(mix(epc(tev(v0)),epc(tod(e2q()))),(v40=txp())!=0?tpc(v40):spc(spp()))
  //  中間コード4
  //    (p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(tev(e4p())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):mix(mix(epc(tev(p)),epc(tod(e2q()))),(p=txp())!=0?tpc(p):spc(spp()))
  //  中間コード5
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(p=epc(e4p()&-2))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=epc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=epc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):mix(mix(epc(p&-2),epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))
  //  中間コード6
  //    (p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(p=epc(e4p()&-2))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):p==1?(p=epc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=epc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):cto(mix(mix(epc(p&-2),epc(e2q()|1)),(p=txp())!=0?tpc(p):spc(spp())))
  E4TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //E4TS_XHPGT

  //================================================================================
  //F1TS ($0001,$24xx,$0063)
  //  概要
  //    F1TS  512ドット256色1プレーン＞テキスト＞スプライト
  //    拡張なし
  //  手順
  //    1番目のカラーが0でないとき
  //      1番目のカラー
  //    さもなくば(1番目のカラーが0のとき)
  //      テキストパレットが0でないとき
  //        テキストカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        スプライトカラー(0は黒)
  //  中間コード1
  //    (fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp())))
  //  中間コード2
  //    fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=fpc(f1p()))!=0?v0:(v2=txp())!=0?tpc(v2):spc(spp())
  //  中間コード4
  //    (p=fpc(f1p()))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=fpc(f1p()))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=fpc(f1p()))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  F1TS {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p;
          XEiJ.pnlBM[da] = ((p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1TS

  //================================================================================
  //XF1TS
  //  概要
  //    F1TS  512ドット256色1プレーン＞テキスト＞スプライト
  //    拡張あり
  XF1TS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F1TS_XWC
      case 0b00010001:  //F1TS_XWC
      case 0b00010010:  //F1TS_XWC
      case 0b00010011:  //F1TS_XWC
        F1TS_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F1TS_XWP
      case 0b00010101:  //F1TS_XWP
      case 0b00010110:  //F1TS_XWP
      case 0b00010111:  //F1TS_XWP
        F1TS_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F1TS_XHC
        F1TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F1TS_XHCT
        F1TS_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F1TS_XHCG
        F1TS_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F1TS_XHCGT
        F1TS_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F1TS_XHPT
        F1TS_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F1TS_XHPG
        F1TS_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F1TS_XHPGT
        F1TS_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F1TS_A
      case 0b01000001:  //F1TS_A
      case 0b01000010:  //F1TS_A
      case 0b01000011:  //F1TS_A
      case 0b01000100:  //F1TS_A
      case 0b01000101:  //F1TS_A
      case 0b01000110:  //F1TS_A
      case 0b01000111:  //F1TS_A
      case 0b01001000:  //F1TS_A
      case 0b01001001:  //F1TS_A
      case 0b01001010:  //F1TS_A
      case 0b01001011:  //F1TS_A
      case 0b01001100:  //F1TS_A
      case 0b01001101:  //F1TS_A
      case 0b01001110:  //F1TS_A
      case 0b01001111:  //F1TS_A
      case 0b01010000:  //F1TS_A
      case 0b01010001:  //F1TS_A
      case 0b01010010:  //F1TS_A
      case 0b01010011:  //F1TS_A
      case 0b01010100:  //F1TS_A
      case 0b01010101:  //F1TS_A
      case 0b01010110:  //F1TS_A
      case 0b01010111:  //F1TS_A
      case 0b01011000:  //F1TS_A
      case 0b01011001:  //F1TS_A
      case 0b01011010:  //F1TS_A
      case 0b01011011:  //F1TS_A
      case 0b01011100:  //F1TS_A
      case 0b01011101:  //F1TS_A
      case 0b01011110:  //F1TS_A
      case 0b01011111:  //F1TS_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        F1TS.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF1TS);
      }  //switch
    }  //drawRaster
  },  //XF1TS

  //================================================================================
  //F1TS_XWC ($0001,$24xx,$1063)
  //  概要
  //    F1TS  512ドット256色1プレーン＞テキスト＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=fpc(v3))!=0?v5:(v6=txp())!=0?tpc(v6):spc(spp())
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  F1TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1TS_XWC

  //================================================================================
  //F1TS_XWP ($0001,$24xx,$1463)
  //  概要
  //    F1TS  512ドット256色1プレーン＞テキスト＞スプライト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(fpc(0)!=0?fpc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?fpc(0)!=0?fpc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=fpc(0))!=0?v1:(v2=txp())!=0?tpc(v2):spc(spp()):ls1(v0)==0?(v7=fpc(v0))!=0?v7:(v8=txp())!=0?tpc(v8):spc(spp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=fpc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=fpc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):fpo(p&-2)
  F1TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1TS_XWP

  //================================================================================
  //F1TS_XHCT ($0001,$24xx,$1963)
  //  概要
  //    F1TS  512ドット256色1プレーン＞テキスト＞スプライト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラーと
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),(txp()!=0?tpc(txp()):spc(spp()))):(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),txp()!=0?tpc(txp()):spc(spp())):fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?mix(fpc(v3),(v6=txp())!=0?tpc(v6):spc(spp())):(v10=fpc(v3))!=0?v10:(v11=txp())!=0?tpc(v11):spc(spp())
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp()))):(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  F1TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1TS_XHCT

  //================================================================================
  //F1TS_XHCG ($0001,$24xx,$1A63)
  //  概要
  //    F1TS  512ドット256色1プレーン＞テキスト＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが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())):(txp()!=0?tpc(txp()):spc(spp()))):(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):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())):txp()!=0?tpc(txp()):spc(spp()):fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(v1,fpc(tod(f2q()))):ls1(v3)!=0?(v9=fpc(tod(f2q())))!=0?v9:(v12=txp())!=0?tpc(v12):spc(spp()):(v16=fpc(v3))!=0?v16:(v17=txp())!=0?tpc(v17):spc(spp())
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=fpc(q))!=0?p:(p=txp())!=0?tpc(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:(p=txp())!=0?tpc(p):spc(spp()):(p=fpc(q))!=0?p:(p=txp())!=0?tpc(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):(p=txp())!=0?tpo(p):spo(spp()):(p=fpc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  F1TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1TS_XHCG

  //================================================================================
  //F1TS_XHCGT ($0001,$24xx,$1B63)
  //  概要
  //    F1TS  512ドット256色1プレーン＞テキスト＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //      を混ぜたカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      1番目のパレットが奇数のとき
  //        2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //        さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //      さもなくば(1番目のパレットが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),(txp()!=0?tpc(txp()):spc(spp()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):(txp()!=0?tpc(txp()):spc(spp()))):(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp())))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),txp()!=0?tpc(txp()):spc(spp())):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):txp()!=0?tpc(txp()):spc(spp()):fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    ls1(v1=fpc(tev(v3=f1p())))!=0?mix(mix(v1,fpc(tod(f2q()))),(v9=txp())!=0?tpc(v9):spc(spp())):ls1(v3)!=0?(v14=fpc(tod(f2q())))!=0?v14:(v17=txp())!=0?tpc(v17):spc(spp()):(v21=fpc(v3))!=0?v21:(v22=txp())!=0?tpc(v22):spc(spp())
  //  中間コード4
  //    ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),(p=txp())!=0?tpc(p):spc(spp())):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=fpc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    ((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),(p=txp())!=0?tpc(p):spc(spp())):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p=fpc(q))!=0?p:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    ((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),(p=txp())!=0?tpc(p):spc(spp()))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p=fpc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  F1TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = (((p = 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]),
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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]),
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F1TS_XHCGT

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

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

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

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

  //================================================================================
  //XF2TS
  //  概要
  //    F2TS  512ドット256色2プレーン＞テキスト＞スプライト
  //    拡張あり
  XF2TS {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //F2TS_XWC
      case 0b00010001:  //F2TS_XWC
      case 0b00010010:  //F2TS_XWC
      case 0b00010011:  //F2TS_XWC
        F2TS_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //F2TS_XWP
      case 0b00010101:  //F2TS_XWP
      case 0b00010110:  //F2TS_XWP
      case 0b00010111:  //F2TS_XWP
        F2TS_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //F2TS_XHC
        F2TS.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //F2TS_XHCT
        F2TS_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //F2TS_XHCG
        F2TS_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //F2TS_XHCGT
        F2TS_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //F2TS_XHPT
        F2TS_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //F2TS_XHPG
        F2TS_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //F2TS_XHPGT
        F2TS_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //F2TS_A
      case 0b01000001:  //F2TS_A
      case 0b01000010:  //F2TS_A
      case 0b01000011:  //F2TS_A
      case 0b01000100:  //F2TS_A
      case 0b01000101:  //F2TS_A
      case 0b01000110:  //F2TS_A
      case 0b01000111:  //F2TS_A
      case 0b01001000:  //F2TS_A
      case 0b01001001:  //F2TS_A
      case 0b01001010:  //F2TS_A
      case 0b01001011:  //F2TS_A
      case 0b01001100:  //F2TS_A
      case 0b01001101:  //F2TS_A
      case 0b01001110:  //F2TS_A
      case 0b01001111:  //F2TS_A
      case 0b01010000:  //F2TS_A
      case 0b01010001:  //F2TS_A
      case 0b01010010:  //F2TS_A
      case 0b01010011:  //F2TS_A
      case 0b01010100:  //F2TS_A
      case 0b01010101:  //F2TS_A
      case 0b01010110:  //F2TS_A
      case 0b01010111:  //F2TS_A
      case 0b01011000:  //F2TS_A
      case 0b01011001:  //F2TS_A
      case 0b01011010:  //F2TS_A
      case 0b01011011:  //F2TS_A
      case 0b01011100:  //F2TS_A
      case 0b01011101:  //F2TS_A
      case 0b01011110:  //F2TS_A
      case 0b01011111:  //F2TS_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        F2TS.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XF2TS);
      }  //switch
    }  //drawRaster
  },  //XF2TS

  //================================================================================
  //F2TS_XWC ($0001,$24xx,$106F)
  //  概要
  //    F2TS  512ドット256色2プレーン＞テキスト＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(fpc(f2p())!=0?fpc(f2p()):(txp()!=0?tpc(txp()):spc(spp())))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp()):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=fpc(v0))!=0?v5:(v6=txp())!=0?tpc(v6):spc(spp()):ls1(fpc(tev(v13=f2p())))!=0?fpc(v13):(v15=fpc(v13))!=0?v15:(v16=txp())!=0?tpc(v16):spc(spp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  F2TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2TS_XWC

  //================================================================================
  //F2TS_XWP ($0001,$24xx,$146F)
  //  概要
  //    F2TS  512ドット256色2プレーン＞テキスト＞スプライト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      2番目のパレットを偶数化したパレットのカラーが0でないとき
  //        2番目のパレットを偶数化したパレットのカラー
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      グラフィックパレット0のカラーが0でないとき
  //        グラフィックパレット0のカラー
  //      さもなくば(グラフィックパレット0のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        テキストパレットが0でないとき
  //          テキストカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?(fpc(tev(f2p()))!=0?fpc(tev(f2p())):(txp()!=0?tpc(txp()):spc(spp()))):f1p()==1?(fpc(0)!=0?fpc(0):(txp()!=0?tpc(txp()):spc(spp()))):ls1(f1p())==0?(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?fpc(tev(f2p()))!=0?fpc(tev(f2p())):txp()!=0?tpc(txp()):spc(spp()):f1p()==1?fpc(0)!=0?fpc(0):txp()!=0?tpc(txp()):spc(spp()):ls1(f1p())==0?fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=fpc(tev(f2p())))!=0?v1:(v4=txp())!=0?tpc(v4):spc(spp()):v0==1?(v8=fpc(0))!=0?v8:(v9=txp())!=0?tpc(v9):spc(spp()):ls1(v0)==0?(v14=fpc(v0))!=0?v14:(v15=txp())!=0?tpc(v15):spc(spp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?(p=fpc(tev(f2p())))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=fpc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):ls1(p)==0?(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):p==1?(p=fpc(0))!=0?p:(p=txp())!=0?tpc(p):spc(spp()):(p&1)==0?(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?(p=fpc(f2p()&-2))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):p==1?(p=fpc(0))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp()):(p&1)==0?(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):fpo(p&-2)
  F2TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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
      }  //if ts==0
    }  //drawRaster
  },  //F2TS_XWP

  //================================================================================
  //F2TS_XHCT ($0001,$24xx,$196F)
  //  概要
  //    F2TS  512ドット256色2プレーン＞テキスト＞スプライト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラーと
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),(txp()!=0?tpc(txp()):spc(spp()))):(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp())))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),(txp()!=0?tpc(txp()):spc(spp()))):(fpc(f2p())!=0?fpc(f2p()):(txp()!=0?tpc(txp()):spc(spp())))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),txp()!=0?tpc(txp()):spc(spp())):fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),txp()!=0?tpc(txp()):spc(spp())):fpc(f2p())!=0?fpc(f2p()):txp()!=0?tpc(txp()):spc(spp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?mix(fpc(v0),(v6=txp())!=0?tpc(v6):spc(spp())):(v10=fpc(v0))!=0?v10:(v11=txp())!=0?tpc(v11):spc(spp()):ls1(fpc(tev(v18=f2p())))!=0?mix(fpc(v18),(v21=txp())!=0?tpc(v21):spc(spp())):(v25=fpc(v18))!=0?v25:(v26=txp())!=0?tpc(v26):spc(spp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp())):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp())
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp()))):(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),(p=txp())!=0?tpc(p):spc(spp()))):(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp())
  F2TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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],
                                (p = tp >>> 28) != 0 ?
                                VideoController.vcnPal16TS[p] :
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 24 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 20 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 16 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 12 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 8 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp >>> 4 & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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],
                                    (p = tp & 15) != 0 ?
                                    VideoController.vcnPal16TS[p] :
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2TS_XHCT

  //================================================================================
  //F2TS_XHCG ($0001,$24xx,$1A6F)
  //  概要
  //    F2TS  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でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            テキストパレットが0でないとき
  //              テキストカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          テキストパレットが0でないとき
  //            テキストカラー(0は黒)
  //          さもなくば(テキストパレットが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())):(txp()!=0?tpc(txp()):spc(spp()))):(fpc(f1p())!=0?fpc(f1p()):(txp()!=0?tpc(txp()):spc(spp()))))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):(fpc(f2p())!=0?fpc(f2p()):(txp()!=0?tpc(txp()):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())):txp()!=0?tpc(txp()):spc(spp()):fpc(f1p())!=0?fpc(f1p()):txp()!=0?tpc(txp()):spc(spp()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())!=0?fpc(f2p()):txp()!=0?tpc(txp()):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:(v12=txp())!=0?tpc(v12):spc(spp()):(v16=fpc(v0))!=0?v16:(v17=txp())!=0?tpc(v17):spc(spp()):ls1(v22=fpc(tev(v24=f2p())))!=0?mix(v22,fpc(tod(f2q()))):(v29=fpc(v24))!=0?v29:(v30=txp())!=0?tpc(v30):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:(p=txp())!=0?tpc(p):spc(spp()):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):(p=fpc(q))!=0?p:(p=txp())!=0?tpc(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:(p=txp())!=0?tpc(p):spc(spp()):(q=fpc(p))!=0?q:(p=txp())!=0?tpc(p):spc(spp()):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(p=fpc(q))!=0?p:(p=txp())!=0?tpc(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):(p=txp())!=0?tpo(p):spo(spp()):(q=fpc(p))!=0?cto(q):(p=txp())!=0?tpo(p):spo(spp()):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(p=fpc(q))!=0?cto(p):(p=txp())!=0?tpo(p):spo(spp())
  F2TS_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = (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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[p] :
                            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] :
                            (p = tp >>> 28) != 0 ?
                            VideoController.vcnPal32TS[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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 24 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 20 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 16 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 12 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 8 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp >>> 4 & 15) != 0 ?
                                VideoController.vcnPal32TS[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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                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] :
                                (p = tp & 15) != 0 ?
                                VideoController.vcnPal32TS[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //F2TS_XHCG

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //XTE1S
  //  概要
  //    TE1S  テキスト＞512ドット16色1プレーン＞スプライト
  //    拡張あり
  XTE1S {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE1S_XWC
      case 0b00010001:  //TE1S_XWC
      case 0b00010010:  //TE1S_XWC
      case 0b00010011:  //TE1S_XWC
        TE1S_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE1S_XWP
      case 0b00010101:  //TE1S_XWP
      case 0b00010110:  //TE1S_XWP
      case 0b00010111:  //TE1S_XWP
        TE1S_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE1S_XHC
        TE1S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE1S_XHCT
        TE1S_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE1S_XHCG
        TE1S_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE1S_XHCGT
        TE1S_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE1S_XHPT
        TE1S_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE1S_XHPG
        TE1S_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE1S_XHPGT
        TE1S_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE1S_A
      case 0b01000001:  //TE1S_A
      case 0b01000010:  //TE1S_A
      case 0b01000011:  //TE1S_A
      case 0b01000100:  //TE1S_A
      case 0b01000101:  //TE1S_A
      case 0b01000110:  //TE1S_A
      case 0b01000111:  //TE1S_A
      case 0b01001000:  //TE1S_A
      case 0b01001001:  //TE1S_A
      case 0b01001010:  //TE1S_A
      case 0b01001011:  //TE1S_A
      case 0b01001100:  //TE1S_A
      case 0b01001101:  //TE1S_A
      case 0b01001110:  //TE1S_A
      case 0b01001111:  //TE1S_A
      case 0b01010000:  //TE1S_A
      case 0b01010001:  //TE1S_A
      case 0b01010010:  //TE1S_A
      case 0b01010011:  //TE1S_A
      case 0b01010100:  //TE1S_A
      case 0b01010101:  //TE1S_A
      case 0b01010110:  //TE1S_A
      case 0b01010111:  //TE1S_A
      case 0b01011000:  //TE1S_A
      case 0b01011001:  //TE1S_A
      case 0b01011010:  //TE1S_A
      case 0b01011011:  //TE1S_A
      case 0b01011100:  //TE1S_A
      case 0b01011101:  //TE1S_A
      case 0b01011110:  //TE1S_A
      case 0b01011111:  //TE1S_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        TE1S.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE1S);
      }  //switch
    }  //drawRaster
  },  //XTE1S

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

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

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

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

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

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

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

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

  //================================================================================
  //TE2S ($0000,$21xx,$0063)
  //  概要
  //    TE2S  テキスト＞512ドット16色2プレーン＞スプライト
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):epc(e2p()))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):spc(spp())):(epc(e2p())!=0?epc(e2p()):spc(spp()))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):epc(e2p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):spc(spp()):epc(e2p())!=0?epc(e2p()):spc(spp())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):epc(e2p()):(v6=e1p())!=0?(v7=epc(v6))!=0?v7:spc(spp()):(v10=epc(e2p()))!=0?v10:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e2p()))!=0?p:spc(spp())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e2p()))!=0?p:spc(spp())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?epo(p):epo(e2p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=epc(e2p()))!=0?cto(p):spo(spp())
  TE2S {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = 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[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = 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[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = 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[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = 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[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = 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[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = 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[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = 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[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = 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[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = 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[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = 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[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = 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[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = 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[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = 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[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = 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[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2S

  //================================================================================
  //XTE2S
  //  概要
  //    TE2S  テキスト＞512ドット16色2プレーン＞スプライト
  //    拡張あり
  XTE2S {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE2S_XWC
      case 0b00010001:  //TE2S_XWC
      case 0b00010010:  //TE2S_XWC
      case 0b00010011:  //TE2S_XWC
        TE2S_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE2S_XWP
      case 0b00010101:  //TE2S_XWP
      case 0b00010110:  //TE2S_XWP
      case 0b00010111:  //TE2S_XWP
        TE2S_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE2S_XHC
        TE2S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE2S_XHCT
        TE2S_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE2S_XHCG
        TE2S_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE2S_XHCGT
        TE2S_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE2S_XHPT
        TE2S_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE2S_XHPG
        TE2S_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE2S_XHPGT
        TE2S_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE2S_A
      case 0b01000001:  //TE2S_A
      case 0b01000010:  //TE2S_A
      case 0b01000011:  //TE2S_A
      case 0b01000100:  //TE2S_A
      case 0b01000101:  //TE2S_A
      case 0b01000110:  //TE2S_A
      case 0b01000111:  //TE2S_A
      case 0b01001000:  //TE2S_A
      case 0b01001001:  //TE2S_A
      case 0b01001010:  //TE2S_A
      case 0b01001011:  //TE2S_A
      case 0b01001100:  //TE2S_A
      case 0b01001101:  //TE2S_A
      case 0b01001110:  //TE2S_A
      case 0b01001111:  //TE2S_A
      case 0b01010000:  //TE2S_A
      case 0b01010001:  //TE2S_A
      case 0b01010010:  //TE2S_A
      case 0b01010011:  //TE2S_A
      case 0b01010100:  //TE2S_A
      case 0b01010101:  //TE2S_A
      case 0b01010110:  //TE2S_A
      case 0b01010111:  //TE2S_A
      case 0b01011000:  //TE2S_A
      case 0b01011001:  //TE2S_A
      case 0b01011010:  //TE2S_A
      case 0b01011011:  //TE2S_A
      case 0b01011100:  //TE2S_A
      case 0b01011101:  //TE2S_A
      case 0b01011110:  //TE2S_A
      case 0b01011111:  //TE2S_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        TE2S.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE2S);
      }  //switch
    }  //drawRaster
  },  //XTE2S

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

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

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

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

  //================================================================================
  //TE2S_XHCGT ($0000,$21xx,$1B63)
  //  概要
  //    TE2S  テキスト＞512ドット16色2プレーン＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())))):(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())))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(spp())):(epc(e2p())!=0?epc(e2p()):spc(spp())))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):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()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(spp())):epc(e2p())!=0?epc(e2p()):spc(spp())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v17=epc(tev(v19=e2p())))!=0?mix(mix(v17,epc(tod(e2q()))),0):epc(v19):(v26=e1p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(tod(e2q()))),spc(spp())):ls1(v26)!=0?(v38=epc(tod(e2q())))!=0?v38:spc(spp()):(v43=epc(v26))!=0?v43:spc(spp()):ls1(v47=epc(tev(v49=e2p())))!=0?mix(mix(v47,epc(tod(e2q()))),spc(spp())):(v57=epc(v49))!=0?v57:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),0):epc(q):(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()):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),spc(spp())):(p=epc(q))!=0?p:spc(spp())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):epc(q):(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=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),spc(spp())):(p=epc(q))!=0?p:spc(spp())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):epo(q):(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=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),spc(spp()))):(p=epc(q))!=0?cto(p):spo(spp())
  TE2S_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q] :
                            (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    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;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q] :
                            (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    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;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2S_XHCGT

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

  //================================================================================
  //TE2S_XHPG ($0000,$21xx,$1E63)
  //  概要
  //    TE2S  テキスト＞512ドット16色2プレーン＞スプライト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))))):(e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):spc(spp()))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))):e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):spc(spp())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2p()))):(v15=e1p())==0?(v16=epc(tev(e2p())))!=0?v16:spc(spp()):v15==1?(v21=epc(0))!=0?v21:spc(spp()):ls1(v15)==0?(v25=epc(v15))!=0?v25:spc(spp()):(v28=mix(epc(tev(v15)),epc(tod(e2p()))))!=0?v28:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p()))):(p=e1p())==0?(p=epc(tev(e2p())))!=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(e2p()))))!=0?q:spc(spp())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1)):(p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)))!=0?q:spc(spp())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1))):(p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)))!=0?cto(q):spo(spp())
  TE2S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2S_XHPG

  //================================================================================
  //TE2S_XHPGT ($0000,$21xx,$1F63)
  //  概要
  //    TE2S  テキスト＞512ドット16色2プレーン＞スプライト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0))):(e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p()))),spc(spp()))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0):e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):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(e2p()))),spc(spp()))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2p()))),0):(v16=e1p())==0?(v17=epc(tev(e2p())))!=0?v17:spc(spp()):v16==1?(v22=epc(0))!=0?v22:spc(spp()):ls1(v16)==0?(v26=epc(v16))!=0?v26:spc(spp()):mix(mix(epc(tev(v16)),epc(tod(e2p()))),spc(spp()))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2p()))),0):(p=e1p())==0?(p=epc(tev(e2p())))!=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(e2p()))),spc(spp()))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2p()|1)),0):(p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)),spc(spp()))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2p()|1)),0)):(p=e1p())==0?(p=epc(e2p()&-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(e2p()|1)),spc(spp())))
  TE2S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 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[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 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[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2S_XHPGT

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

  //================================================================================
  //XTE3S
  //  概要
  //    TE3S  テキスト＞512ドット16色3プレーン＞スプライト
  //    拡張あり
  XTE3S {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE3S_XWC
      case 0b00010001:  //TE3S_XWC
      case 0b00010010:  //TE3S_XWC
      case 0b00010011:  //TE3S_XWC
        TE3S_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE3S_XWP
      case 0b00010101:  //TE3S_XWP
      case 0b00010110:  //TE3S_XWP
      case 0b00010111:  //TE3S_XWP
        TE3S_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE3S_XHC
        TE3S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE3S_XHCT
        TE3S_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE3S_XHCG
        TE3S_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE3S_XHCGT
        TE3S_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE3S_XHPT
        TE3S_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE3S_XHPG
        TE3S_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE3S_XHPGT
        TE3S_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE3S_A
      case 0b01000001:  //TE3S_A
      case 0b01000010:  //TE3S_A
      case 0b01000011:  //TE3S_A
      case 0b01000100:  //TE3S_A
      case 0b01000101:  //TE3S_A
      case 0b01000110:  //TE3S_A
      case 0b01000111:  //TE3S_A
      case 0b01001000:  //TE3S_A
      case 0b01001001:  //TE3S_A
      case 0b01001010:  //TE3S_A
      case 0b01001011:  //TE3S_A
      case 0b01001100:  //TE3S_A
      case 0b01001101:  //TE3S_A
      case 0b01001110:  //TE3S_A
      case 0b01001111:  //TE3S_A
      case 0b01010000:  //TE3S_A
      case 0b01010001:  //TE3S_A
      case 0b01010010:  //TE3S_A
      case 0b01010011:  //TE3S_A
      case 0b01010100:  //TE3S_A
      case 0b01010101:  //TE3S_A
      case 0b01010110:  //TE3S_A
      case 0b01010111:  //TE3S_A
      case 0b01011000:  //TE3S_A
      case 0b01011001:  //TE3S_A
      case 0b01011010:  //TE3S_A
      case 0b01011011:  //TE3S_A
      case 0b01011100:  //TE3S_A
      case 0b01011101:  //TE3S_A
      case 0b01011110:  //TE3S_A
      case 0b01011111:  //TE3S_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        TE3S.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE3S);
      }  //switch
    }  //drawRaster
  },  //XTE3S

  //================================================================================
  //TE3S_XWC ($0000,$21xx,$1067)
  //  概要
  //    TE3S  テキスト＞512ドット16色3プレーン＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストパレットが0でないとき
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストパレットが0でないとき
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              3番目のカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(spp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):spc(spp())))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e3p())):(epc(e3p())!=0?epc(e3p()):spc(spp()))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):spc(spp()):ls1(epc(tev(e3p())))!=0?epc(e3p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e3p()):epc(e3p())!=0?epc(e3p()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:spc(spp()):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?epc(v11):(v16=txp())!=0?(v17=tpc(v16))!=0?v17:epc(v11):(v19=epc(v11))!=0?v19:spc(spp()):ls1(epc(tev(v25=e3p())))!=0?epc(v25):(v27=txp())!=0?(v28=tpc(v27))!=0?v28:epc(v25):(v30=epc(v25))!=0?v30:spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):ls1(epc(tev(p=e3p())))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(epc((p=e3p())&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp())
  TE3S_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3S_XWC

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

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

  //================================================================================
  //TE3S_XHCG ($0000,$21xx,$1A67)
  //  概要
  //    TE3S  テキスト＞512ドット16色3プレーン＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p())))))):(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()))):(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())))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):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()):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())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):ls1(v25=epc(tev(v27=e3p())))!=0?mix(v25,epc(1)):ls1(v27)!=0?epc(1):epc(v27):(v33=e1p())!=0?ls1(v35=epc(tev(v33)))!=0?mix(v35,epc(tod(e2q()))):ls1(v33)!=0?(v42=epc(tod(e2q())))!=0?v42:spc(spp()):(v47=epc(v33))!=0?v47:spc(spp()):(v50=e2p())!=0?ls1(v52=epc(tev(v50)))!=0?mix(v52,epc(tod(e2q()))):(v58=epc(v50))!=0?v58:spc(spp()):ls1(v62=epc(tev(v64=e3p())))!=0?mix(v62,epc(1)):ls1(v64)!=0?(v68=epc(1))!=0?v68:spc(spp()):(v71=epc(v64))!=0?v71:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(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()):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:spc(spp()):(p=epc(q))!=0?p:spc(spp())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(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=epc((q=e3p())&-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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(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=epc((q=e3p())&-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())
  TE3S_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3S_XHCG

  //================================================================================
  //TE3S_XHCGT ($0000,$21xx,$1B67)
  //  概要
  //    TE3S  テキスト＞512ドット16色3プレーン＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              スプライトカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p())))))):(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()))):(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())))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):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()):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())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):ls1(v27=epc(tev(v29=e3p())))!=0?mix(mix(v27,epc(1)),0):ls1(v29)!=0?epc(1):epc(v29):(v36=e1p())!=0?ls1(v38=epc(tev(v36)))!=0?mix(mix(v38,epc(tod(e2q()))),spc(spp())):ls1(v36)!=0?(v48=epc(tod(e2q())))!=0?v48:spc(spp()):(v53=epc(v36))!=0?v53:spc(spp()):(v56=e2p())!=0?ls1(v58=epc(tev(v56)))!=0?mix(mix(v58,epc(tod(e2q()))),spc(spp())):(v67=epc(v56))!=0?v67:spc(spp()):ls1(v71=epc(tev(v73=e3p())))!=0?mix(mix(v71,epc(1)),spc(spp())):ls1(v73)!=0?(v80=epc(1))!=0?v80:spc(spp()):(v83=epc(v73))!=0?v83:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(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()):ls1(p=epc(tev(q=e3p())))!=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=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(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=epc((q=e3p())&-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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(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=epc((q=e3p())&-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())
  TE3S_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3S_XHCGT

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

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

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

  //================================================================================
  //TE4S ($0000,$21xx,$006F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //      さもなくば(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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):(e3p()!=0?epc(e3p()):epc(e4p()))))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):spc(spp())):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):spc(spp())):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):spc(spp())):(epc(e4p())!=0?epc(e4p()):spc(spp()))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):e3p()!=0?epc(e3p()):epc(e4p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?epc(e2p())!=0?epc(e2p()):spc(spp()):e3p()!=0?epc(e3p())!=0?epc(e3p()):spc(spp()):epc(e4p())!=0?epc(e4p()):spc(spp())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):(v6=e3p())!=0?epc(v6):epc(e4p()):(v10=e1p())!=0?(v11=epc(v10))!=0?v11:spc(spp()):(v14=e2p())!=0?(v15=epc(v14))!=0?v15:spc(spp()):(v18=e3p())!=0?(v19=epc(v18))!=0?v19:spc(spp()):(v22=epc(e4p()))!=0?v22:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()))!=0?p:spc(spp())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?(q=epc(p))!=0?q:spc(spp()):(p=epc(e4p()))!=0?p:spc(spp())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):(p=e3p())!=0?epo(p):epo(e4p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p())!=0?(q=epc(p))!=0?cto(q):spo(spp()):(p=epc(e4p()))!=0?cto(p):spo(spp())
  TE4S {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (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]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 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]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S

  //================================================================================
  //XTE4S
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    拡張あり
  XTE4S {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE4S_XWC
      case 0b00010001:  //TE4S_XWC
      case 0b00010010:  //TE4S_XWC
      case 0b00010011:  //TE4S_XWC
        TE4S_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE4S_XWP
      case 0b00010101:  //TE4S_XWP
      case 0b00010110:  //TE4S_XWP
      case 0b00010111:  //TE4S_XWP
        TE4S_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE4S_XHC
        TE4S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE4S_XHCT
        TE4S_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE4S_XHCG
        TE4S_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE4S_XHCGT
        TE4S_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE4S_XHPT
        TE4S_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE4S_XHPG
        TE4S_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE4S_XHPGT
        TE4S_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE4S_A
      case 0b01000001:  //TE4S_A
      case 0b01000010:  //TE4S_A
      case 0b01000011:  //TE4S_A
      case 0b01000100:  //TE4S_A
      case 0b01000101:  //TE4S_A
      case 0b01000110:  //TE4S_A
      case 0b01000111:  //TE4S_A
      case 0b01001000:  //TE4S_A
      case 0b01001001:  //TE4S_A
      case 0b01001010:  //TE4S_A
      case 0b01001011:  //TE4S_A
      case 0b01001100:  //TE4S_A
      case 0b01001101:  //TE4S_A
      case 0b01001110:  //TE4S_A
      case 0b01001111:  //TE4S_A
      case 0b01010000:  //TE4S_A
      case 0b01010001:  //TE4S_A
      case 0b01010010:  //TE4S_A
      case 0b01010011:  //TE4S_A
      case 0b01010100:  //TE4S_A
      case 0b01010101:  //TE4S_A
      case 0b01010110:  //TE4S_A
      case 0b01010111:  //TE4S_A
      case 0b01011000:  //TE4S_A
      case 0b01011001:  //TE4S_A
      case 0b01011010:  //TE4S_A
      case 0b01011011:  //TE4S_A
      case 0b01011100:  //TE4S_A
      case 0b01011101:  //TE4S_A
      case 0b01011110:  //TE4S_A
      case 0b01011111:  //TE4S_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        TE4S.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE4S);
      }  //switch
    }  //drawRaster
  },  //XTE4S

  //================================================================================
  //TE4S_XWC ($0000,$21xx,$106F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストパレットが0でないとき
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストパレットが0でないとき
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストパレットが0でないとき
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                4番目のカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                スプライトカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(spp())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):spc(spp())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e3p())):(epc(e3p())!=0?epc(e3p()):spc(spp())))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e4p())):(epc(e4p())!=0?epc(e4p()):spc(spp())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(spp()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):spc(spp()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e3p()):epc(e3p())!=0?epc(e3p()):spc(spp()):ls1(epc(tev(e4p())))!=0?epc(e4p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e4p()):epc(e4p())!=0?epc(e4p()):spc(spp())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:spc(spp()):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?epc(v11):(v16=txp())!=0?(v17=tpc(v16))!=0?v17:epc(v11):(v19=epc(v11))!=0?v19:spc(spp()):(v22=e3p())!=0?ls1(epc(tev(v22)))!=0?epc(v22):(v27=txp())!=0?(v28=tpc(v27))!=0?v28:epc(v22):(v30=epc(v22))!=0?v30:spc(spp()):ls1(epc(tev(v36=e4p())))!=0?epc(v36):(v38=txp())!=0?(v39=tpc(v38))!=0?v39:epc(v36):(v41=epc(v36))!=0?v41:spc(spp())
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp())
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp())
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp()):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp())
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XWC

  //================================================================================
  //TE4S_XWP ($0000,$21xx,$146F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(テキストパレットが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のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p()))))):((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?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(0)):(epc(0)!=0?epc(0):spc(spp()))):ls1(e1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(spp()))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?txp()!=0?tpc(txp())!=0?tpc(txp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):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?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(0):epc(0)!=0?epc(0):spc(spp()):ls1(e1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(spp()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):(v12=tev(e2p()))!=0?(v14=epc(v12))!=0?v14:spc(spp()):(v17=tev(e3p()))!=0?(v19=epc(v17))!=0?v19:spc(spp()):(v22=epc(tev(e4p())))!=0?v22:spc(spp()):v0==1?(v27=txp())!=0?(v28=tpc(v27))!=0?v28:epc(0):(v30=epc(0))!=0?v30:spc(spp()):ls1(v0)==0?(v34=txp())!=0?(v35=tpc(v34))!=0?v35:epc(v0):(v37=epc(v0))!=0?v37:spc(spp()):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):(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=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(spp()):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):(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=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(spp()):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(spp()):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):(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=txp())!=0?(q=tpc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(spp()):epo(p&-2)
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = 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 = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = 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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = 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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = 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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = 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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = 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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = 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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = 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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = 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 = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = 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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = 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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = 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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = 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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = 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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = 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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = 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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XWP

  //================================================================================
  //TE4S_XHCT ($0000,$21xx,$196F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),0):epc(v16):ls1(epc(tev(v26=e4p())))!=0?mix(epc(v26),0):epc(v26):(v30=e1p())!=0?ls1(epc(tev(v30)))!=0?mix(epc(v30),spc(spp())):(v38=epc(v30))!=0?v38:spc(spp()):(v41=e2p())!=0?ls1(epc(tev(v41)))!=0?mix(epc(v41),spc(spp())):(v49=epc(v41))!=0?v49:spc(spp()):(v52=e3p())!=0?ls1(epc(tev(v52)))!=0?mix(epc(v52),spc(spp())):(v60=epc(v52))!=0?v60:spc(spp()):ls1(epc(tev(v66=e4p())))!=0?mix(epc(v66),spc(spp())):(v71=epc(v66))!=0?v71:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p):(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=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(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())
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XHCT

  //================================================================================
  //TE4S_XHCG ($0000,$21xx,$1A6F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p()):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):(v24=e3p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(1)):ls1(v24)!=0?epc(1):epc(v24):ls1(v34=epc(tev(v36=e4p())))!=0?mix(v34,epc(1)):ls1(v36)!=0?epc(1):epc(v36):(v42=e1p())!=0?ls1(v44=epc(tev(v42)))!=0?mix(v44,epc(tod(e2q()))):ls1(v42)!=0?(v51=epc(tod(e2q())))!=0?v51:spc(spp()):(v56=epc(v42))!=0?v56:spc(spp()):(v59=e2p())!=0?ls1(v61=epc(tev(v59)))!=0?mix(v61,epc(tod(e2q()))):(v67=epc(v59))!=0?v67:spc(spp()):(v70=e3p())!=0?ls1(v72=epc(tev(v70)))!=0?mix(v72,epc(1)):ls1(v70)!=0?(v77=epc(1))!=0?v77:spc(spp()):(v80=epc(v70))!=0?v80:spc(spp()):ls1(v84=epc(tev(v86=e4p())))!=0?mix(v84,epc(1)):ls1(v86)!=0?(v90=epc(1))!=0?v90:spc(spp()):(v93=epc(v86))!=0?v93:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(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=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(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())
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XHCG

  //================================================================================
  //TE4S_XHCGT ($0000,$21xx,$1B6F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p()):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):(v26=e3p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(1)),0):ls1(v26)!=0?epc(1):epc(v26):ls1(v37=epc(tev(v39=e4p())))!=0?mix(mix(v37,epc(1)),0):ls1(v39)!=0?epc(1):epc(v39):(v46=e1p())!=0?ls1(v48=epc(tev(v46)))!=0?mix(mix(v48,epc(tod(e2q()))),spc(spp())):ls1(v46)!=0?(v58=epc(tod(e2q())))!=0?v58:spc(spp()):(v63=epc(v46))!=0?v63:spc(spp()):(v66=e2p())!=0?ls1(v68=epc(tev(v66)))!=0?mix(mix(v68,epc(tod(e2q()))),spc(spp())):(v77=epc(v66))!=0?v77:spc(spp()):(v80=e3p())!=0?ls1(v82=epc(tev(v80)))!=0?mix(mix(v82,epc(1)),spc(spp())):ls1(v80)!=0?(v90=epc(1))!=0?v90:spc(spp()):(v93=epc(v80))!=0?v93:spc(spp()):ls1(v97=epc(tev(v99=e4p())))!=0?mix(mix(v97,epc(1)),spc(spp())):ls1(v99)!=0?(v106=epc(1))!=0?v106:spc(spp()):(v109=epc(v99))!=0?v109:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(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=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(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())
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XHCGT

  //================================================================================
  //TE4S_XHPT ($0000,$21xx,$1D6F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0):(v18=e1p())==0?(v19=tev(e2p()))!=0?(v21=epc(v19))!=0?v21:spc(spp()):(v24=tev(e3p()))!=0?(v26=epc(v24))!=0?v26:spc(spp()):(v29=epc(tev(e4p())))!=0?v29:spc(spp()):v18==1?(v34=epc(0))!=0?v34:spc(spp()):ls1(v18)==0?(v38=epc(v18))!=0?v38:spc(spp()):mix(epc(tev(v18)),spc(spp()))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0):(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=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0)):(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())))
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XHPT

  //================================================================================
  //TE4S_XHPG ($0000,$21xx,$1E6F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q()))):(v21=e1p())==0?(v22=tev(e2p()))!=0?(v24=epc(v22))!=0?v24:spc(spp()):(v27=tev(e3p()))!=0?(v29=epc(v27))!=0?v29:spc(spp()):(v32=epc(tev(e4p())))!=0?v32:spc(spp()):v21==1?(v37=epc(0))!=0?v37:spc(spp()):ls1(v21)==0?(v41=epc(v21))!=0?v41:spc(spp()):(v44=mix(epc(tev(v21)),epc(tod(e2q()))))!=0?v44:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(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=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(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())
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XHPG

  //================================================================================
  //TE4S_XHPGT ($0000,$21xx,$1F6F)
  //  概要
  //    TE4S  テキスト＞512ドット16色4プレーン＞スプライト
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0):(v22=e1p())==0?(v23=tev(e2p()))!=0?(v25=epc(v23))!=0?v25:spc(spp()):(v28=tev(e3p()))!=0?(v30=epc(v28))!=0?v30:spc(spp()):(v33=epc(tev(e4p())))!=0?v33:spc(spp()):v22==1?(v38=epc(0))!=0?v38:spc(spp()):ls1(v22)==0?(v42=epc(v22))!=0?v42:spc(spp()):mix(mix(epc(tev(v22)),epc(tod(e2q()))),spc(spp()))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0):(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=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0)):(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())))
  TE4S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TE4S_XHPGT

  //================================================================================
  //TF1S ($0001,$21xx,$0063)
  //  概要
  //    TF1S  テキスト＞512ドット256色1プレーン＞スプライト
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(spp())))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(spp())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:fpc(f1p()):(v4=fpc(f1p()))!=0?v4:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:spc(spp())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:spc(spp())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):fpo(f1p()):(p=fpc(f1p()))!=0?cto(p):spo(spp())
  TF1S {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TF1S

  //================================================================================
  //XTF1S
  //  概要
  //    TF1S  テキスト＞512ドット256色1プレーン＞スプライト
  //    拡張あり
  XTF1S {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TF1S_XWC
      case 0b00010001:  //TF1S_XWC
      case 0b00010010:  //TF1S_XWC
      case 0b00010011:  //TF1S_XWC
        TF1S_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TF1S_XWP
      case 0b00010101:  //TF1S_XWP
      case 0b00010110:  //TF1S_XWP
      case 0b00010111:  //TF1S_XWP
        TF1S_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TF1S_XHC
        TF1S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TF1S_XHCT
        TF1S_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TF1S_XHCG
        TF1S_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TF1S_XHCGT
        TF1S_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TF1S_XHPT
        TF1S_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TF1S_XHPG
        TF1S_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TF1S_XHPGT
        TF1S_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TF1S_A
      case 0b01000001:  //TF1S_A
      case 0b01000010:  //TF1S_A
      case 0b01000011:  //TF1S_A
      case 0b01000100:  //TF1S_A
      case 0b01000101:  //TF1S_A
      case 0b01000110:  //TF1S_A
      case 0b01000111:  //TF1S_A
      case 0b01001000:  //TF1S_A
      case 0b01001001:  //TF1S_A
      case 0b01001010:  //TF1S_A
      case 0b01001011:  //TF1S_A
      case 0b01001100:  //TF1S_A
      case 0b01001101:  //TF1S_A
      case 0b01001110:  //TF1S_A
      case 0b01001111:  //TF1S_A
      case 0b01010000:  //TF1S_A
      case 0b01010001:  //TF1S_A
      case 0b01010010:  //TF1S_A
      case 0b01010011:  //TF1S_A
      case 0b01010100:  //TF1S_A
      case 0b01010101:  //TF1S_A
      case 0b01010110:  //TF1S_A
      case 0b01010111:  //TF1S_A
      case 0b01011000:  //TF1S_A
      case 0b01011001:  //TF1S_A
      case 0b01011010:  //TF1S_A
      case 0b01011011:  //TF1S_A
      case 0b01011100:  //TF1S_A
      case 0b01011101:  //TF1S_A
      case 0b01011110:  //TF1S_A
      case 0b01011111:  //TF1S_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        TF1S.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTF1S);
      }  //switch
    }  //drawRaster
  },  //XTF1S

  //================================================================================
  //TF1S_XWC ($0001,$21xx,$1063)
  //  概要
  //    TF1S  テキスト＞512ドット256色1プレーン＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(spp())
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:fpc(v3):(v8=fpc(v3))!=0?v8:spc(spp())
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp())
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp())
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(spp())
  TF1S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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
      }  //if ts==0
    }  //drawRaster
  },  //TF1S_XWC

  //================================================================================
  //TF1S_XWP ($0001,$21xx,$1463)
  //  概要
  //    TF1S  テキスト＞512ドット256色1プレーン＞スプライト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(0)):(fpc(0)!=0?fpc(0):spc(spp()))):ls1(f1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(0):fpc(0)!=0?fpc(0):spc(spp()):ls1(f1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(spp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:fpc(0):(v4=fpc(0))!=0?v4:spc(spp()):ls1(v0)==0?(v8=txp())!=0?(v9=tpc(v8))!=0?v9:fpc(v0):(v11=fpc(v0))!=0?v11:spc(spp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:spc(spp()):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):fpo(0):(p=fpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(spp()):fpo(p&-2)
  TF1S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TF1S_XWP

  //================================================================================
  //TF1S_XHCT ($0001,$21xx,$1963)
  //  概要
  //    TF1S  テキスト＞512ドット256色1プレーン＞スプライト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          スプライトカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()))):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(spp())):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(spp())):fpc(f1p())!=0?fpc(f1p()):spc(spp())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(fpc(tev(v5=f1p())))!=0?mix(fpc(v5),0):fpc(v5):ls1(fpc(tev(v12=f1p())))!=0?mix(fpc(v12),spc(spp())):(v17=fpc(v12))!=0?v17:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),0):fpc(p):ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),0):fpc(p):(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),spc(spp())):(q=fpc(p))!=0?q:spc(spp())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),spc(spp()))):(q=fpc(p))!=0?cto(q):spo(spp())
  TF1S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TF1S_XHCT

  //================================================================================
  //TF1S_XHCG ($0001,$21xx,$1A63)
  //  概要
  //    TF1S  テキスト＞512ドット256色1プレーン＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):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
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(v3,fpc(tod(f2q()))):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5):ls1(v16=fpc(tev(v18=f1p())))!=0?mix(v16,fpc(tod(f2q()))):ls1(v18)!=0?(v24=fpc(tod(f2q())))!=0?v24:spc(spp()):(v29=fpc(v18))!=0?v29:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?fpc(tod(f2q())):fpc(q):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=txp())!=0?(q=tpc(p))!=0?q:((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?fpc(f2q()|1):fpc(q):((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=txp())!=0?(q=tpc(p))!=0?cto(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?fpo(f2q()|1):fpo(q):((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())
  TF1S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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
      }  //if ts==0
    }  //drawRaster
  },  //TF1S_XHCG

  //================================================================================
  //TF1S_XHCGT ($0001,$21xx,$1B63)
  //  概要
  //    TF1S  テキスト＞512ドット256色1プレーン＞スプライト
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))):(ls1(fpc(tev(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(fpc(tev(f1p())))!=0?mix(mix(fpc(tev(f1p())),fpc(tod(f2q()))),0):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(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
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(mix(v3,fpc(tod(f2q()))),0):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5):ls1(v17=fpc(tev(v19=f1p())))!=0?mix(mix(v17,fpc(tod(f2q()))),spc(spp())):ls1(v19)!=0?(v28=fpc(tod(f2q())))!=0?v28:spc(spp()):(v33=fpc(v19))!=0?v33:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(p=fpc(tev(q=f1p())))!=0?mix(mix(p,fpc(tod(f2q()))),0):ls1(q)!=0?fpc(tod(f2q())):fpc(q):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=txp())!=0?(q=tpc(p))!=0?q:((p=fpc((q=f1p())&-2))&1)!=0?mix(mix(p,fpc(f2q()|1)),0):(q&1)!=0?fpc(f2q()|1):fpc(q):((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=txp())!=0?(q=tpc(p))!=0?cto(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(mix(p,fpc(f2q()|1)),0)):(q&1)!=0?fpo(f2q()|1):fpo(q):((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())
  TF1S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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
      }  //if ts==0
    }  //drawRaster
  },  //TF1S_XHCGT

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

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

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

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

  //================================================================================
  //XTF2S
  //  概要
  //    TF2S  テキスト＞512ドット256色2プレーン＞スプライト
  //    拡張あり
  XTF2S {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TF2S_XWC
      case 0b00010001:  //TF2S_XWC
      case 0b00010010:  //TF2S_XWC
      case 0b00010011:  //TF2S_XWC
        TF2S_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TF2S_XWP
      case 0b00010101:  //TF2S_XWP
      case 0b00010110:  //TF2S_XWP
      case 0b00010111:  //TF2S_XWP
        TF2S_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TF2S_XHC
        TF2S.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TF2S_XHCT
        TF2S_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TF2S_XHCG
        TF2S_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TF2S_XHCGT
        TF2S_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TF2S_XHPT
        TF2S_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TF2S_XHPG
        TF2S_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TF2S_XHPGT
        TF2S_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TF2S_A
      case 0b01000001:  //TF2S_A
      case 0b01000010:  //TF2S_A
      case 0b01000011:  //TF2S_A
      case 0b01000100:  //TF2S_A
      case 0b01000101:  //TF2S_A
      case 0b01000110:  //TF2S_A
      case 0b01000111:  //TF2S_A
      case 0b01001000:  //TF2S_A
      case 0b01001001:  //TF2S_A
      case 0b01001010:  //TF2S_A
      case 0b01001011:  //TF2S_A
      case 0b01001100:  //TF2S_A
      case 0b01001101:  //TF2S_A
      case 0b01001110:  //TF2S_A
      case 0b01001111:  //TF2S_A
      case 0b01010000:  //TF2S_A
      case 0b01010001:  //TF2S_A
      case 0b01010010:  //TF2S_A
      case 0b01010011:  //TF2S_A
      case 0b01010100:  //TF2S_A
      case 0b01010101:  //TF2S_A
      case 0b01010110:  //TF2S_A
      case 0b01010111:  //TF2S_A
      case 0b01011000:  //TF2S_A
      case 0b01011001:  //TF2S_A
      case 0b01011010:  //TF2S_A
      case 0b01011011:  //TF2S_A
      case 0b01011100:  //TF2S_A
      case 0b01011101:  //TF2S_A
      case 0b01011110:  //TF2S_A
      case 0b01011111:  //TF2S_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        TF2S.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTF2S);
      }  //switch
    }  //drawRaster
  },  //XTF2S

  //================================================================================
  //TF2S_XWC ($0001,$21xx,$106F)
  //  概要
  //    TF2S  テキスト＞512ドット256色2プレーン＞スプライト
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(spp())))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f2p())):(fpc(f2p())!=0?fpc(f2p()):spc(spp())))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(spp()):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):spc(spp())
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:fpc(v0):(v8=fpc(v0))!=0?v8:spc(spp()):ls1(fpc(tev(v14=f2p())))!=0?fpc(v14):(v16=txp())!=0?(v17=tpc(v16))!=0?v17:fpc(v14):(v19=fpc(v14))!=0?v19:spc(spp())
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp()):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp())
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp()):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp())
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(spp()):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(spp())
  TF2S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                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
      }  //if ts==0
    }  //drawRaster
  },  //TF2S_XWC

  //================================================================================
  //TF2S_XWP ($0001,$21xx,$146F)
  //  概要
  //    TF2S  テキスト＞512ドット256色2プレーン＞スプライト
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが1のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(tev(f2p()))):(fpc(tev(f2p()))!=0?fpc(tev(f2p())):spc(spp()))):f1p()==1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(0)):(fpc(0)!=0?fpc(0):spc(spp()))):ls1(f1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(spp()))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()==0?txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(tev(f2p())):fpc(tev(f2p()))!=0?fpc(tev(f2p())):spc(spp()):f1p()==1?txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(0):fpc(0)!=0?fpc(0):spc(spp()):ls1(f1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(spp()):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())==0?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:fpc(tev(f2p())):(v6=fpc(tev(f2p())))!=0?v6:spc(spp()):v0==1?(v11=txp())!=0?(v12=tpc(v11))!=0?v12:fpc(0):(v14=fpc(0))!=0?v14:spc(spp()):ls1(v0)==0?(v18=txp())!=0?(v19=tpc(v18))!=0?v19:fpc(v0):(v21=fpc(v0))!=0?v21:spc(spp()):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(tev(f2p())):(p=fpc(tev(f2p())))!=0?p:spc(spp()):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:spc(spp()):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp()):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(f2p()&-2):(p=fpc(f2p()&-2))!=0?p:spc(spp()):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:spc(spp()):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(spp()):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())==0?(p=txp())!=0?(q=tpc(p))!=0?cto(q):fpo(f2p()&-2):(p=fpc(f2p()&-2))!=0?cto(p):spo(spp()):p==1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):fpo(0):(p=fpc(0))!=0?cto(p):spo(spp()):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(spp()):fpo(p&-2)
  TF2S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                            (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 = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                                (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] :
                            (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 = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx]] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] :
                                (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 1]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 2]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 3]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 4]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 5]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 6]] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[SpriteScreen.sprBuffer[sx + 7]] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TF2S_XWP

  //================================================================================
  //TF2S_XHCT ($0001,$21xx,$196F)
  //  概要
  //    TF2S  テキスト＞512ドット256色2プレーン＞スプライト
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p())):(ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p())))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(f2p()),0):fpc(f2p()):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=f1p())!=0?ls1(fpc(tev(v2)))!=0?mix(fpc(v2),0):fpc(v2):ls1(fpc(tev(v12=f2p())))!=0?mix(fpc(v12),0):fpc(v12):(v16=f1p())!=0?ls1(fpc(tev(v16)))!=0?mix(fpc(v16),spc(spp())):(v24=fpc(v16))!=0?v24:spc(spp()):ls1(fpc(tev(v30=f2p())))!=0?mix(fpc(v30),spc(spp())):(v35=fpc(v30))!=0?v35:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=f1p())!=0?ls1(fpc(tev(p)))!=0?mix(fpc(p),0):fpc(p):ls1(fpc(tev(p=f2p())))!=0?mix(fpc(p),0):fpc(p):(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=txp())!=0?(q=tpc(p))!=0?q:(p=f1p())!=0?(fpc(p&-2)&1)!=0?mix(fpc(p),0):fpc(p):(fpc((p=f2p())&-2)&1)!=0?mix(fpc(p),0):fpc(p):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=f1p())!=0?(fpc(p&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(fpc((p=f2p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(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())
  TF2S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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
      }  //if ts==0
    }  //drawRaster
  },  //TF2S_XHCT

  //================================================================================
  //TF2S_XHCG ($0001,$21xx,$1A6F)
  //  概要
  //    TF2S  テキスト＞512ドット256色2プレーン＞スプライト
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      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
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(f1p()!=0?(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()))):(ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p())))):(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
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):f1p()!=0?ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f2p())))!=0?mix(fpc(tev(f2p())),fpc(tod(f2q()))):fpc(f2p()):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=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=f1p())!=0?ls1(v4=fpc(tev(v2)))!=0?mix(v4,fpc(tod(f2q()))):ls1(v2)!=0?fpc(tod(f2q())):fpc(v2):ls1(v16=fpc(tev(v18=f2p())))!=0?mix(v16,fpc(tod(f2q()))):fpc(v18):(v24=f1p())!=0?ls1(v26=fpc(tev(v24)))!=0?mix(v26,fpc(tod(f2q()))):ls1(v24)!=0?(v33=fpc(tod(f2q())))!=0?v33:spc(spp()):(v38=fpc(v24))!=0?v38:spc(spp()):ls1(v42=fpc(tev(v44=f2p())))!=0?mix(v42,fpc(tod(f2q()))):(v49=fpc(v44))!=0?v49:spc(spp())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=f1p())!=0?ls1(q=fpc(tev(p)))!=0?mix(q,fpc(tod(f2q()))):ls1(p)!=0?fpc(tod(f2q())):fpc(p):ls1(p=fpc(tev(q=f2p())))!=0?mix(p,fpc(tod(f2q()))):fpc(q):(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=txp())!=0?(q=tpc(p))!=0?q:(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?mix(q,fpc(f2q()|1)):(p&1)!=0?fpc(f2q()|1):fpc(p):((p=fpc((q=f2p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):fpc(q):(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=txp())!=0?(q=tpc(p))!=0?cto(q):(p=f1p())!=0?((q=fpc(p&-2))&1)!=0?cto(mix(q,fpc(f2q()|1))):(p&1)!=0?fpo(f2q()|1):fpo(p):((p=fpc((q=f2p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):fpo(q):(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())
  TF2S_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                                   GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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 = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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 = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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 = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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 = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (p = (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
      }  //if ts==0
    }  //drawRaster
  },  //TF2S_XHCG

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //TE1s ($0000,$21xx,$0021)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0)))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:epc(e1p()):(v4=epc(e1p()))!=0?v4:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:epc(e1p()):(p=epc(e1p()))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:epc(e1p()):(p=epc(e1p()))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):epo(e1p()):(p=epc(e1p()))!=0?cto(p):spo(0)
  TE1s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st & 511]] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy1st | gx1st + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s

  //================================================================================
  //XTE1s
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    拡張あり
  XTE1s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE1s_XWC
      case 0b00010001:  //TE1s_XWC
      case 0b00010010:  //TE1s_XWC
      case 0b00010011:  //TE1s_XWC
        TE1s_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE1s_XWP
      case 0b00010101:  //TE1s_XWP
      case 0b00010110:  //TE1s_XWP
      case 0b00010111:  //TE1s_XWP
        TE1s_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE1s_XHC
        TE1s.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE1s_XHCT
        TE1s_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE1s_XHCG
        TE1s_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE1s_XHCGT
        TE1s_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE1s_XHPT
        TE1s_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE1s_XHPG
        TE1s_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE1s_XHPGT
        TE1s_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE1s_A
      case 0b01000001:  //TE1s_A
      case 0b01000010:  //TE1s_A
      case 0b01000011:  //TE1s_A
      case 0b01000100:  //TE1s_A
      case 0b01000101:  //TE1s_A
      case 0b01000110:  //TE1s_A
      case 0b01000111:  //TE1s_A
      case 0b01001000:  //TE1s_A
      case 0b01001001:  //TE1s_A
      case 0b01001010:  //TE1s_A
      case 0b01001011:  //TE1s_A
      case 0b01001100:  //TE1s_A
      case 0b01001101:  //TE1s_A
      case 0b01001110:  //TE1s_A
      case 0b01001111:  //TE1s_A
      case 0b01010000:  //TE1s_A
      case 0b01010001:  //TE1s_A
      case 0b01010010:  //TE1s_A
      case 0b01010011:  //TE1s_A
      case 0b01010100:  //TE1s_A
      case 0b01010101:  //TE1s_A
      case 0b01010110:  //TE1s_A
      case 0b01010111:  //TE1s_A
      case 0b01011000:  //TE1s_A
      case 0b01011001:  //TE1s_A
      case 0b01011010:  //TE1s_A
      case 0b01011011:  //TE1s_A
      case 0b01011100:  //TE1s_A
      case 0b01011101:  //TE1s_A
      case 0b01011110:  //TE1s_A
      case 0b01011111:  //TE1s_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        TE1s.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE1s);
      }  //switch
    }  //drawRaster
  },  //XTE1s

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

  //================================================================================
  //TE1s_XWP ($0000,$21xx,$1421)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()<=1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(0)):(epc(0)!=0?epc(0):spc(0))):ls1(e1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()<=1?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(0):epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())<=1?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:epc(0):(v4=epc(0))!=0?v4:spc(0):ls1(v0)==0?(v7=txp())!=0?(v8=tpc(v7))!=0?v8:epc(v0):(v10=epc(v0))!=0?v10:spc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):epo(p&-2)
  TE1s_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s_XWP

  //================================================================================
  //TE1s_XHCT ($0000,$21xx,$1921)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()))):(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):epc(e1p())!=0?epc(e1p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(epc(tev(v5=e1p())))!=0?mix(epc(v5),0):epc(v5):ls1(epc(tev(v12=e1p())))!=0?mix(epc(v12),spc(0)):(v16=epc(v12))!=0?v16:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(epc(tev(p=e1p())))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e1p())))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(epc((p=e1p())&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e1p())&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e1p())&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0)
  TE1s_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s_XHCT

  //================================================================================
  //TE1s_XHCG ($0000,$21xx,$1A21)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())))):(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0):epc(e1p())!=0?epc(e1p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(v3=epc(tev(v5=e1p())))!=0?mix(v3,epc(tod(e2q()))):ls1(v5)!=0?epc(tod(e2q())):epc(v5):ls1(v16=epc(tev(v18=e1p())))!=0?mix(v16,epc(tod(e2q()))):ls1(v18)!=0?(v24=epc(tod(e2q())))!=0?v24:spc(0):(v28=epc(v18))!=0?v28:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?epc(tod(e2q())):epc(q):ls1(p=epc(tev(q=e1p())))!=0?mix(p,epc(tod(e2q()))):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?epc(e2q()|1):epc(q):((p=epc((q=e1p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?epo(e2q()|1):epo(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(0):(p=epc(q))!=0?cto(p):spo(0)
  TE1s_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s_XHCG

  //================================================================================
  //TE1s_XHCGT ($0000,$21xx,$1B21)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p())))):(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0):epc(e1p())!=0?epc(e1p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(v3=epc(tev(v5=e1p())))!=0?mix(mix(v3,epc(tod(e2q()))),0):ls1(v5)!=0?epc(tod(e2q())):epc(v5):ls1(v17=epc(tev(v19=e1p())))!=0?mix(mix(v17,epc(tod(e2q()))),spc(0)):ls1(v19)!=0?(v27=epc(tod(e2q())))!=0?v27:spc(0):(v31=epc(v19))!=0?v31:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),0):ls1(q)!=0?epc(tod(e2q())):epc(q):ls1(p=epc(tev(q=e1p())))!=0?mix(mix(p,epc(tod(e2q()))),spc(0)):ls1(q)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):(q&1)!=0?epc(e2q()|1):epc(q):((p=epc((q=e1p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),spc(0)):(q&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):(q&1)!=0?epo(e2q()|1):epo(q):((p=epc((q=e1p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),spc(0))):(q&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(0):(p=epc(q))!=0?cto(p):spo(0)
  TE1s_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s_XHCGT

  //================================================================================
  //TE1s_XHPT ($0000,$21xx,$1D21)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))):(e1p()<=1?(epc(0)!=0?epc(0):spc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(0)):mix(epc(tev(e1p())),spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0):e1p()<=1?epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(0):mix(epc(tev(e1p())),spc(0))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0):(v9=e1p())<=1?(v10=epc(0))!=0?v10:spc(0):ls1(v9)==0?(v13=epc(v9))!=0?v13:spc(0):mix(epc(tev(v9)),spc(0))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0):(p=e1p())<=1?(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=epc(p))!=0?q:spc(0):mix(epc(tev(p)),spc(0))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0):(p=e1p())<=1?(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=epc(p))!=0?q:spc(0):mix(epc(p&-2),spc(0))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0)):(p=e1p())<=1?(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=epc(p))!=0?cto(q):spo(0):cto(mix(epc(p&-2),spc(0)))
  TE1s_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s_XHPT

  //================================================================================
  //TE1s_XHPG ($0000,$21xx,$1E21)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(e1p()<=1?(epc(0)!=0?epc(0):spc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(0)):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):e1p()<=1?epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(0):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q()))):(v12=e1p())<=1?(v13=epc(0))!=0?v13:spc(0):ls1(v12)==0?(v16=epc(v12))!=0?v16:spc(0):(v18=mix(epc(tev(v12)),epc(tod(e2q()))))!=0?v18:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(p=e1p())<=1?(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=epc(p))!=0?q:spc(0):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(p=e1p())<=1?(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=epc(p))!=0?q:spc(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(p=e1p())<=1?(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=epc(p))!=0?cto(q):spo(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):spo(0)
  TE1s_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s_XHPG

  //================================================================================
  //TE1s_XHPGT ($0000,$21xx,$1F21)
  //  概要
  //    TE1s  テキスト＞512ドット16色1プレーン＞スプライト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0))):(e1p()<=1?(epc(0)!=0?epc(0):spc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()<=1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):e1p()<=1?epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(0):mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())<=1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2q()))),0):(v13=e1p())<=1?(v14=epc(0))!=0?v14:spc(0):ls1(v13)==0?(v17=epc(v13))!=0?v17:spc(0):mix(mix(epc(tev(v13)),epc(tod(e2q()))),spc(0))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())<=1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2q()))),0):(p=e1p())<=1?(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=epc(p))!=0?q:spc(0):mix(mix(epc(tev(p)),epc(tod(e2q()))),spc(0))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())<=1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2q()|1)),0):(p=e1p())<=1?(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=epc(p))!=0?q:spc(0):mix(mix(epc(p&-2),epc(e2q()|1)),spc(0))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())<=1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2q()|1)),0)):(p=e1p())<=1?(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=epc(p))!=0?cto(q):spo(0):cto(mix(mix(epc(p&-2),epc(e2q()|1)),spc(0)))
  TE1s_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) <= 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) <= 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE1s_XHPGT

  //================================================================================
  //TE2s ($0000,$21xx,$0023)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のカラーが0でないとき
  //          2番目のカラー
  //        さもなくば(2番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):epc(e2p()))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):spc(0)):(epc(e2p())!=0?epc(e2p()):spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):epc(e2p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):spc(0):epc(e2p())!=0?epc(e2p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):epc(e2p()):(v6=e1p())!=0?(v7=epc(v6))!=0?v7:spc(0):(v9=epc(e2p()))!=0?v9:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e2p()))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e2p()))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?epo(p):epo(e2p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):spo(0):(p=epc(e2p()))!=0?cto(p):spo(0)
  TE2s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s

  //================================================================================
  //XTE2s
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    拡張あり
  XTE2s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE2s_XWC
      case 0b00010001:  //TE2s_XWC
      case 0b00010010:  //TE2s_XWC
      case 0b00010011:  //TE2s_XWC
        TE2s_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE2s_XWP
      case 0b00010101:  //TE2s_XWP
      case 0b00010110:  //TE2s_XWP
      case 0b00010111:  //TE2s_XWP
        TE2s_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE2s_XHC
        TE2s.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE2s_XHCT
        TE2s_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE2s_XHCG
        TE2s_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE2s_XHCGT
        TE2s_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE2s_XHPT
        TE2s_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE2s_XHPG
        TE2s_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE2s_XHPGT
        TE2s_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE2s_A
      case 0b01000001:  //TE2s_A
      case 0b01000010:  //TE2s_A
      case 0b01000011:  //TE2s_A
      case 0b01000100:  //TE2s_A
      case 0b01000101:  //TE2s_A
      case 0b01000110:  //TE2s_A
      case 0b01000111:  //TE2s_A
      case 0b01001000:  //TE2s_A
      case 0b01001001:  //TE2s_A
      case 0b01001010:  //TE2s_A
      case 0b01001011:  //TE2s_A
      case 0b01001100:  //TE2s_A
      case 0b01001101:  //TE2s_A
      case 0b01001110:  //TE2s_A
      case 0b01001111:  //TE2s_A
      case 0b01010000:  //TE2s_A
      case 0b01010001:  //TE2s_A
      case 0b01010010:  //TE2s_A
      case 0b01010011:  //TE2s_A
      case 0b01010100:  //TE2s_A
      case 0b01010101:  //TE2s_A
      case 0b01010110:  //TE2s_A
      case 0b01010111:  //TE2s_A
      case 0b01011000:  //TE2s_A
      case 0b01011001:  //TE2s_A
      case 0b01011010:  //TE2s_A
      case 0b01011011:  //TE2s_A
      case 0b01011100:  //TE2s_A
      case 0b01011101:  //TE2s_A
      case 0b01011110:  //TE2s_A
      case 0b01011111:  //TE2s_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        TE2s.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE2s);
      }  //switch
    }  //drawRaster
  },  //XTE2s

  //================================================================================
  //TE2s_XWC ($0000,$21xx,$1023)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0)))):(ls1(epc(tev(e2p())))!=0?epc(e2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):spc(0)))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0):ls1(epc(tev(e2p())))!=0?epc(e2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):spc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:spc(0):ls1(epc(tev(v13=e2p())))!=0?epc(v13):(v15=txp())!=0?(v16=tpc(v15))!=0?v16:epc(v13):(v18=epc(v13))!=0?v18:spc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):ls1(epc(tev(p=e2p())))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(epc((p=e2p())&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):(epc((p=e2p())&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0)
  TE2s_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XWC

  //================================================================================
  //TE2s_XWP ($0000,$21xx,$1423)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(tev(e2p()))):(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0))):e1p()==1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(0)):(epc(0)!=0?epc(0):spc(0))):ls1(e1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(tev(e2p())):epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0):e1p()==1?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(0):epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:epc(tev(e2p())):(v6=epc(tev(e2p())))!=0?v6:spc(0):v0==1?(v10=txp())!=0?(v11=tpc(v10))!=0?v11:epc(0):(v13=epc(0))!=0?v13:spc(0):ls1(v0)==0?(v16=txp())!=0?(v17=tpc(v16))!=0?v17:epc(v0):(v19=epc(v0))!=0?v19:spc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:epc(tev(e2p())):(p=epc(tev(e2p())))!=0?p:spc(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:epc(e2p()&-2):(p=epc(e2p()&-2))!=0?p:spc(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?cto(q):epo(e2p()&-2):(p=epc(e2p()&-2))!=0?cto(p):spo(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):epo(p&-2)
  TE2s_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XWP

  //================================================================================
  //TE2s_XHCT ($0000,$21xx,$1923)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーと
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラーと
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0))):(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(0)):(epc(e2p())!=0?epc(e2p()):spc(0)))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):epc(e1p())!=0?epc(e1p()):spc(0):ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(0)):epc(e2p())!=0?epc(e2p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):ls1(epc(tev(v12=e2p())))!=0?mix(epc(v12),0):epc(v12):(v16=e1p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),spc(0)):(v23=epc(v16))!=0?v23:spc(0):ls1(epc(tev(v28=e2p())))!=0?mix(epc(v28),spc(0)):(v32=epc(v28))!=0?v32:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):ls1(epc(tev(p=e2p())))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(epc((p=e2p())&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0):(epc((p=e2p())&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0)
  TE2s_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XHCT

  //================================================================================
  //TE2s_XHCG ($0000,$21xx,$1A23)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())))):(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(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))):(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):spc(0)))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):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(0):epc(e1p())!=0?epc(e1p()):spc(0):ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v16=epc(tev(v18=e2p())))!=0?mix(v16,epc(tod(e2q()))):epc(v18):(v24=e1p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(tod(e2q()))):ls1(v24)!=0?(v33=epc(tod(e2q())))!=0?v33:spc(0):(v37=epc(v24))!=0?v37:spc(0):ls1(v40=epc(tev(v42=e2p())))!=0?mix(v40,epc(tod(e2q()))):(v47=epc(v42))!=0?v47:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):ls1(p=epc(tev(q=e2p())))!=0?mix(p,epc(tod(e2q()))):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):((p=epc((q=e2p())&-2))&1)!=0?mix(p,epc(e2q()|1)):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):epo(q):(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(0):(q=epc(p))!=0?cto(q):spo(0):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(p,epc(e2q()|1))):(p=epc(q))!=0?cto(p):spo(0)
  TE2s_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XHCG

  //================================================================================
  //TE2s_XHCGT ($0000,$21xx,$1B23)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))):(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(0)):(epc(e2p())!=0?epc(e2p()):spc(0)))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0):epc(e1p())!=0?epc(e1p()):spc(0):ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(0)):epc(e2p())!=0?epc(e2p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):ls1(v17=epc(tev(v19=e2p())))!=0?mix(mix(v17,epc(tod(e2q()))),0):epc(v19):(v26=e1p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(tod(e2q()))),spc(0)):ls1(v26)!=0?(v37=epc(tod(e2q())))!=0?v37:spc(0):(v41=epc(v26))!=0?v41:spc(0):ls1(v44=epc(tev(v46=e2p())))!=0?mix(mix(v44,epc(tod(e2q()))),spc(0)):(v53=epc(v46))!=0?v53:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),0):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),spc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):ls1(p=epc(tev(q=e2p())))!=0?mix(mix(p,epc(tod(e2q()))),spc(0)):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),0):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),spc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):((p=epc((q=e2p())&-2))&1)!=0?mix(mix(p,epc(e2q()|1)),spc(0)):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),0)):epo(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),spc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(0):(q=epc(p))!=0?cto(q):spo(0):((p=epc((q=e2p())&-2))&1)!=0?cto(mix(mix(p,epc(e2q()|1)),spc(0))):(p=epc(q))!=0?cto(p):spo(0)
  TE2s_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XHCGT

  //================================================================================
  //TE2s_XHPT ($0000,$21xx,$1D23)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))):(e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0)):e1p()==1?(epc(0)!=0?epc(0):spc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(0)):mix(epc(tev(e1p())),spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0):e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0):e1p()==1?epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(0):mix(epc(tev(e1p())),spc(0))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0):(v12=e1p())==0?(v13=epc(tev(e2p())))!=0?v13:spc(0):v12==1?(v17=epc(0))!=0?v17:spc(0):ls1(v12)==0?(v20=epc(v12))!=0?v20:spc(0):mix(epc(tev(v12)),spc(0))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0):(p=e1p())==0?(p=epc(tev(e2p())))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=epc(p))!=0?q:spc(0):mix(epc(tev(p)),spc(0))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0):(p=e1p())==0?(p=epc(e2p()&-2))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=epc(p))!=0?q:spc(0):mix(epc(p&-2),spc(0))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0)):(p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):spo(0):p==1?(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=epc(p))!=0?cto(q):spo(0):cto(mix(epc(p&-2),spc(0)))
  TE2s_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XHPT

  //================================================================================
  //TE2s_XHPG ($0000,$21xx,$1E23)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))))):(e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0)):e1p()==1?(epc(0)!=0?epc(0):spc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(0)):(mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))):e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0):e1p()==1?epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(0):mix(epc(tev(e1p())),epc(tod(e2p())))!=0?mix(epc(tev(e1p())),epc(tod(e2p()))):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2p()))):(v15=e1p())==0?(v16=epc(tev(e2p())))!=0?v16:spc(0):v15==1?(v20=epc(0))!=0?v20:spc(0):ls1(v15)==0?(v23=epc(v15))!=0?v23:spc(0):(v25=mix(epc(tev(v15)),epc(tod(e2p()))))!=0?v25:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p()))):(p=e1p())==0?(p=epc(tev(e2p())))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=epc(p))!=0?q:spc(0):(q=mix(epc(tev(p)),epc(tod(e2p()))))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1)):(p=e1p())==0?(p=epc(e2p()&-2))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=epc(p))!=0?q:spc(0):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1))):(p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):spo(0):p==1?(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=epc(p))!=0?cto(q):spo(0):(q=mix(epc(p&-2),epc(e2p()|1)))!=0?cto(q):spo(0)
  TE2s_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XHPG

  //================================================================================
  //TE2s_XHPGT ($0000,$21xx,$1F23)
  //  概要
  //    TE2s  テキスト＞512ドット16色2プレーン＞スプライト(OFF)
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットのカラーが0でないとき
  //          2番目のパレットを偶数化したパレットのカラー
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0))):(e1p()==0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0)):e1p()==1?(epc(0)!=0?epc(0):spc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(0)):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0):e1p()==0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0):e1p()==1?epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(0):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),spc(0))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2p()))),0):(v16=e1p())==0?(v17=epc(tev(e2p())))!=0?v17:spc(0):v16==1?(v21=epc(0))!=0?v21:spc(0):ls1(v16)==0?(v24=epc(v16))!=0?v24:spc(0):mix(mix(epc(tev(v16)),epc(tod(e2p()))),spc(0))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2p()))),0):(p=e1p())==0?(p=epc(tev(e2p())))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=epc(p))!=0?q:spc(0):mix(mix(epc(tev(p)),epc(tod(e2p()))),spc(0))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2p()|1)),0):(p=e1p())==0?(p=epc(e2p()&-2))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=epc(p))!=0?q:spc(0):mix(mix(epc(p&-2),epc(e2p()|1)),spc(0))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2p()|1)),0)):(p=e1p())==0?(p=epc(e2p()&-2))!=0?cto(p):spo(0):p==1?(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=epc(p))!=0?cto(q):spo(0):cto(mix(mix(epc(p&-2),epc(e2p()|1)),spc(0)))
  TE2s_XHPGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    VideoController.vcnPal16TS[0])]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE2s_XHPGT

  //================================================================================
  //TE3s ($0000,$21xx,$0027)
  //  概要
  //    TE3s  テキスト＞512ドット16色3プレーン＞スプライト(OFF)
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のカラーが0でないとき
  //            3番目のカラー
  //          さもなくば(3番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):epc(e3p())))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):spc(0)):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):spc(0)):(epc(e3p())!=0?epc(e3p()):spc(0)))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):epc(e3p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?epc(e2p())!=0?epc(e2p()):spc(0):epc(e3p())!=0?epc(e3p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):epc(e3p()):(v8=e1p())!=0?(v9=epc(v8))!=0?v9:spc(0):(v11=e2p())!=0?(v12=epc(v11))!=0?v12:spc(0):(v14=epc(e3p()))!=0?v14:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e3p()))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):epc(e3p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e3p()))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):epo(e3p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?(q=epc(p))!=0?cto(q):spo(0):(p=epc(e3p()))!=0?cto(p):spo(0)
  TE3s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3s

  //================================================================================
  //XTE3s
  //  概要
  //    TE3s  テキスト＞512ドット16色3プレーン＞スプライト(OFF)
  //    拡張あり
  XTE3s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE3s_XWC
      case 0b00010001:  //TE3s_XWC
      case 0b00010010:  //TE3s_XWC
      case 0b00010011:  //TE3s_XWC
        TE3s_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE3s_XWP
      case 0b00010101:  //TE3s_XWP
      case 0b00010110:  //TE3s_XWP
      case 0b00010111:  //TE3s_XWP
        TE3s_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE3s_XHC
        TE3s.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE3s_XHCT
        TE3s_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE3s_XHCG
        TE3s_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE3s_XHCGT
        TE3s_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE3s_XHPT
        TE3s_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE3s_XHPG
        TE3s_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE3s_XHPGT
        TE3s_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE3s_A
      case 0b01000001:  //TE3s_A
      case 0b01000010:  //TE3s_A
      case 0b01000011:  //TE3s_A
      case 0b01000100:  //TE3s_A
      case 0b01000101:  //TE3s_A
      case 0b01000110:  //TE3s_A
      case 0b01000111:  //TE3s_A
      case 0b01001000:  //TE3s_A
      case 0b01001001:  //TE3s_A
      case 0b01001010:  //TE3s_A
      case 0b01001011:  //TE3s_A
      case 0b01001100:  //TE3s_A
      case 0b01001101:  //TE3s_A
      case 0b01001110:  //TE3s_A
      case 0b01001111:  //TE3s_A
      case 0b01010000:  //TE3s_A
      case 0b01010001:  //TE3s_A
      case 0b01010010:  //TE3s_A
      case 0b01010011:  //TE3s_A
      case 0b01010100:  //TE3s_A
      case 0b01010101:  //TE3s_A
      case 0b01010110:  //TE3s_A
      case 0b01010111:  //TE3s_A
      case 0b01011000:  //TE3s_A
      case 0b01011001:  //TE3s_A
      case 0b01011010:  //TE3s_A
      case 0b01011011:  //TE3s_A
      case 0b01011100:  //TE3s_A
      case 0b01011101:  //TE3s_A
      case 0b01011110:  //TE3s_A
      case 0b01011111:  //TE3s_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        TE3s.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE3s);
      }  //switch
    }  //drawRaster
  },  //XTE3s

  //================================================================================
  //TE3s_XWC ($0000,$21xx,$1027)
  //  概要
  //    TE3s  テキスト＞512ドット16色3プレーン＞スプライト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストパレットが0でないとき
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストパレットが0でないとき
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              3番目のカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):spc(0)))):(ls1(epc(tev(e3p())))!=0?epc(e3p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e3p())):(epc(e3p())!=0?epc(e3p()):spc(0))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):spc(0):ls1(epc(tev(e3p())))!=0?epc(e3p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e3p()):epc(e3p())!=0?epc(e3p()):spc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:spc(0):(v10=e2p())!=0?ls1(epc(tev(v10)))!=0?epc(v10):(v15=txp())!=0?(v16=tpc(v15))!=0?v16:epc(v10):(v18=epc(v10))!=0?v18:spc(0):ls1(epc(tev(v23=e3p())))!=0?epc(v23):(v25=txp())!=0?(v26=tpc(v25))!=0?v26:epc(v23):(v28=epc(v23))!=0?v28:spc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):ls1(epc(tev(p=e3p())))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(epc((p=e3p())&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):(epc((p=e3p())&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0)
  TE3s_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3s_XWC

  //================================================================================
  //TE3s_XWP ($0000,$21xx,$1427)
  //  概要
  //    TE3s  テキスト＞512ドット16色3プレーン＞スプライト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが0でないとき
  //            3番目のパレットを偶数化したパレットのカラー
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):((tev(e2p()))!=0?epc(tev(e2p())):epc(tev(e3p())))):((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0)):(epc(tev(e3p()))!=0?epc(tev(e3p())):spc(0)))):e1p()==1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(0)):(epc(0)!=0?epc(0):spc(0))):ls1(e1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?txp()!=0?tpc(txp())!=0?tpc(txp()):tev(e2p())!=0?epc(tev(e2p())):epc(tev(e3p())):tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0):epc(tev(e3p()))!=0?epc(tev(e3p())):spc(0):e1p()==1?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(0):epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:(v3=tev(e2p()))!=0?epc(v3):epc(tev(e3p())):(v9=tev(e2p()))!=0?(v11=epc(v9))!=0?v11:spc(0):(v13=epc(tev(e3p())))!=0?v13:spc(0):v0==1?(v17=txp())!=0?(v18=tpc(v17))!=0?v18:epc(0):(v20=epc(0))!=0?v20:spc(0):ls1(v0)==0?(v23=txp())!=0?(v24=tpc(v23))!=0?v24:epc(v0):(v26=epc(v0))!=0?v26:spc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):epc(tev(e3p())):(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(0):(p=epc(tev(e3p())))!=0?p:spc(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):epc(e3p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e3p()&-2))!=0?p:spc(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):epo(e3p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(0):(p=epc(e3p()&-2))!=0?cto(p):spo(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):epo(p&-2)
  TE3s_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3s_XWP

  //================================================================================
  //TE3s_XHCT ($0000,$21xx,$1927)
  //  概要
  //    TE3s  テキスト＞512ドット16色3プレーン＞スプライト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーと
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーと
  //              スプライトパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラーと
  //              スプライトパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(0)):(epc(e2p())!=0?epc(e2p()):spc(0))):(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(0)):(epc(e3p())!=0?epc(e3p()):spc(0))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(0)):epc(e2p())!=0?epc(e2p()):spc(0):ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(0)):epc(e3p())!=0?epc(e3p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):ls1(epc(tev(v19=e3p())))!=0?mix(epc(v19),0):epc(v19):(v23=e1p())!=0?ls1(epc(tev(v23)))!=0?mix(epc(v23),spc(0)):(v30=epc(v23))!=0?v30:spc(0):(v32=e2p())!=0?ls1(epc(tev(v32)))!=0?mix(epc(v32),spc(0)):(v39=epc(v32))!=0?v39:spc(0):ls1(epc(tev(v44=e3p())))!=0?mix(epc(v44),spc(0)):(v48=epc(v44))!=0?v48:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):ls1(epc(tev(p=e3p())))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(epc((p=e3p())&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0):(epc((p=e3p())&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0)
  TE3s_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3s_XHCT

  //================================================================================
  //TE3s_XHCG ($0000,$21xx,$1A27)
  //  概要
  //    TE3s  テキスト＞512ドット16色3プレーン＞スプライト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p())))))):(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(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):spc(0))):(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):spc(0)):(epc(e3p())!=0?epc(e3p()):spc(0)))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):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(0):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):spc(0):ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):spc(0):epc(e3p())!=0?epc(e3p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):ls1(v25=epc(tev(v27=e3p())))!=0?mix(v25,epc(1)):ls1(v27)!=0?epc(1):epc(v27):(v33=e1p())!=0?ls1(v35=epc(tev(v33)))!=0?mix(v35,epc(tod(e2q()))):ls1(v33)!=0?(v42=epc(tod(e2q())))!=0?v42:spc(0):(v46=epc(v33))!=0?v46:spc(0):(v48=e2p())!=0?ls1(v50=epc(tev(v48)))!=0?mix(v50,epc(tod(e2q()))):(v56=epc(v48))!=0?v56:spc(0):ls1(v59=epc(tev(v61=e3p())))!=0?mix(v59,epc(1)):ls1(v61)!=0?(v65=epc(1))!=0?v65:spc(0):(v67=epc(v61))!=0?v67:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:spc(0):ls1(p=epc(tev(q=e3p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:spc(0):((p=epc((q=e3p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(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(0):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):spo(0):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):spo(0):(p=epc(q))!=0?cto(p):spo(0)
  TE3s_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3s_XHCG

  //================================================================================
  //TE3s_XHCGT ($0000,$21xx,$1B27)
  //  概要
  //    TE3s  テキスト＞512ドット16色3プレーン＞スプライト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //              スプライトパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //              スプライトパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            3番目のパレットが奇数のとき
  //              パレット1のカラーが0でないとき
  //                パレット1のカラー
  //              さもなくば(パレット1のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //            さもなくば(3番目のパレットが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p())))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(0)):(epc(e2p())!=0?epc(e2p()):spc(0))):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),spc(0)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):spc(0)):(epc(e3p())!=0?epc(e3p()):spc(0)))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(0)):epc(e2p())!=0?epc(e2p()):spc(0):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),spc(0)):ls1(e3p())!=0?epc(1)!=0?epc(1):spc(0):epc(e3p())!=0?epc(e3p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):ls1(v27=epc(tev(v29=e3p())))!=0?mix(mix(v27,epc(1)),0):ls1(v29)!=0?epc(1):epc(v29):(v36=e1p())!=0?ls1(v38=epc(tev(v36)))!=0?mix(mix(v38,epc(tod(e2q()))),spc(0)):ls1(v36)!=0?(v47=epc(tod(e2q())))!=0?v47:spc(0):(v51=epc(v36))!=0?v51:spc(0):(v53=e2p())!=0?ls1(v55=epc(tev(v53)))!=0?mix(mix(v55,epc(tod(e2q()))),spc(0)):(v63=epc(v53))!=0?v63:spc(0):ls1(v66=epc(tev(v68=e3p())))!=0?mix(mix(v66,epc(1)),spc(0)):ls1(v68)!=0?(v74=epc(1))!=0?v74:spc(0):(v76=epc(v68))!=0?v76:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),spc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),spc(0)):(q=epc(p))!=0?q:spc(0):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),spc(0)):ls1(q)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),spc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),spc(0)):(q=epc(p))!=0?q:spc(0):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),spc(0)):(q&1)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),spc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(0):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),spc(0))):(q=epc(p))!=0?cto(q):spo(0):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),spc(0))):(q&1)!=0?(p=epc(1))!=0?cto(p):spo(0):(p=epc(q))!=0?cto(p):spo(0)
  TE3s_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    VideoController.vcnPal16TS[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE3s_XHCGT

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

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

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

  //================================================================================
  //TE4s ($0000,$21xx,$002F)
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のカラーが0でないとき
  //              3番目のカラー
  //            さもなくば(3番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のカラーが0でないとき
  //              4番目のカラー
  //            さもなくば(4番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):(e3p()!=0?epc(e3p()):epc(e4p()))))):(e1p()!=0?(epc(e1p())!=0?epc(e1p()):spc(0)):(e2p()!=0?(epc(e2p())!=0?epc(e2p()):spc(0)):(e3p()!=0?(epc(e3p())!=0?epc(e3p()):spc(0)):(epc(e4p())!=0?epc(e4p()):spc(0))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):e3p()!=0?epc(e3p()):epc(e4p()):e1p()!=0?epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?epc(e2p())!=0?epc(e2p()):spc(0):e3p()!=0?epc(e3p())!=0?epc(e3p()):spc(0):epc(e4p())!=0?epc(e4p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):(v6=e3p())!=0?epc(v6):epc(e4p()):(v10=e1p())!=0?(v11=epc(v10))!=0?v11:spc(0):(v13=e2p())!=0?(v14=epc(v13))!=0?v14:spc(0):(v16=e3p())!=0?(v17=epc(v16))!=0?v17:spc(0):(v19=epc(e4p()))!=0?v19:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e4p()))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=e1p())!=0?(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e4p()))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):(p=e3p())!=0?epo(p):epo(e4p()):(p=e1p())!=0?(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?(q=epc(p))!=0?cto(q):spo(0):(p=e3p())!=0?(q=epc(p))!=0?cto(q):spo(0):(p=epc(e4p()))!=0?cto(p):spo(0)
  TE4s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4s

  //================================================================================
  //XTE4s
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    拡張あり
  XTE4s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TE4s_XWC
      case 0b00010001:  //TE4s_XWC
      case 0b00010010:  //TE4s_XWC
      case 0b00010011:  //TE4s_XWC
        TE4s_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TE4s_XWP
      case 0b00010101:  //TE4s_XWP
      case 0b00010110:  //TE4s_XWP
      case 0b00010111:  //TE4s_XWP
        TE4s_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TE4s_XHC
        TE4s.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TE4s_XHCT
        TE4s_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TE4s_XHCG
        TE4s_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TE4s_XHCGT
        TE4s_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TE4s_XHPT
        TE4s_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TE4s_XHPG
        TE4s_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TE4s_XHPGT
        TE4s_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TE4s_A
      case 0b01000001:  //TE4s_A
      case 0b01000010:  //TE4s_A
      case 0b01000011:  //TE4s_A
      case 0b01000100:  //TE4s_A
      case 0b01000101:  //TE4s_A
      case 0b01000110:  //TE4s_A
      case 0b01000111:  //TE4s_A
      case 0b01001000:  //TE4s_A
      case 0b01001001:  //TE4s_A
      case 0b01001010:  //TE4s_A
      case 0b01001011:  //TE4s_A
      case 0b01001100:  //TE4s_A
      case 0b01001101:  //TE4s_A
      case 0b01001110:  //TE4s_A
      case 0b01001111:  //TE4s_A
      case 0b01010000:  //TE4s_A
      case 0b01010001:  //TE4s_A
      case 0b01010010:  //TE4s_A
      case 0b01010011:  //TE4s_A
      case 0b01010100:  //TE4s_A
      case 0b01010101:  //TE4s_A
      case 0b01010110:  //TE4s_A
      case 0b01010111:  //TE4s_A
      case 0b01011000:  //TE4s_A
      case 0b01011001:  //TE4s_A
      case 0b01011010:  //TE4s_A
      case 0b01011011:  //TE4s_A
      case 0b01011100:  //TE4s_A
      case 0b01011101:  //TE4s_A
      case 0b01011110:  //TE4s_A
      case 0b01011111:  //TE4s_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        TE4s.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTE4s);
      }  //switch
    }  //drawRaster
  },  //XTE4s

  //================================================================================
  //TE4s_XWC ($0000,$21xx,$102F)
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストパレットが0でないとき
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストパレットが0でないとき
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストパレットが0でないとき
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                4番目のカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e2p())):(epc(e2p())!=0?epc(e2p()):spc(0)))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e3p())):(epc(e3p())!=0?epc(e3p()):spc(0)))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e4p())):(epc(e4p())!=0?epc(e4p()):spc(0)))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e2p()):epc(e2p())!=0?epc(e2p()):spc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e3p()):epc(e3p())!=0?epc(e3p()):spc(0):ls1(epc(tev(e4p())))!=0?epc(e4p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e4p()):epc(e4p())!=0?epc(e4p()):spc(0)
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:epc(v0):(v8=epc(v0))!=0?v8:spc(0):(v10=e2p())!=0?ls1(epc(tev(v10)))!=0?epc(v10):(v15=txp())!=0?(v16=tpc(v15))!=0?v16:epc(v10):(v18=epc(v10))!=0?v18:spc(0):(v20=e3p())!=0?ls1(epc(tev(v20)))!=0?epc(v20):(v25=txp())!=0?(v26=tpc(v25))!=0?v26:epc(v20):(v28=epc(v20))!=0?v28:spc(0):ls1(epc(tev(v33=e4p())))!=0?epc(v33):(v35=txp())!=0?(v36=tpc(v35))!=0?v36:epc(v33):(v38=epc(v33))!=0?v38:spc(0)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0)
  TE4s_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4s_XWC

  //================================================================================
  //TE4s_XWP ($0000,$21xx,$142F)
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが0でないとき
  //              4番目のパレットを偶数化したパレットのカラー
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが1のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p()))))):((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):spc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):spc(0))))):e1p()==1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(0)):(epc(0)!=0?epc(0):spc(0))):ls1(e1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(epc(e1p())!=0?epc(e1p()):spc(0))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?txp()!=0?tpc(txp())!=0?tpc(txp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):spc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):spc(0):e1p()==1?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(0):epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):epc(e1p())!=0?epc(e1p()):spc(0):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):(v12=tev(e2p()))!=0?(v14=epc(v12))!=0?v14:spc(0):(v16=tev(e3p()))!=0?(v18=epc(v16))!=0?v18:spc(0):(v20=epc(tev(e4p())))!=0?v20:spc(0):v0==1?(v24=txp())!=0?(v25=tpc(v24))!=0?v25:epc(0):(v27=epc(0))!=0?v27:spc(0):ls1(v0)==0?(v30=txp())!=0?(v31=tpc(v30))!=0?v31:epc(v0):(v33=epc(v0))!=0?v33:spc(0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:spc(0):(p=epc(tev(e4p())))!=0?p:spc(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?q:spc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e4p()&-2))!=0?p:spc(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=epc(p))!=0?q:spc(0):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(0):(p=epc(e4p()&-2))!=0?cto(p):spo(0):p==1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):epo(0):(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=epc(p))!=0?cto(q):spo(0):epo(p&-2)
  TE4s_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4s_XWP

  //================================================================================
  //TE4s_XHCT ($0000,$21xx,$192F)
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーと
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のカラーと
  //              スプライトパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のカラーと
  //                スプライトパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のカラーが0でないとき
  //                3番目のカラー
  //              さもなくば(3番目のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のカラーと
  //                スプライトパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のカラーが0でないとき
  //                4番目のカラー
  //              さもなくば(4番目のカラーが0のとき)
  //                スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(0)):(epc(e2p())!=0?epc(e2p()):spc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(0)):(epc(e3p())!=0?epc(e3p()):spc(0))):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),spc(0)):(epc(e4p())!=0?epc(e4p()):spc(0)))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),spc(0)):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),spc(0)):epc(e2p())!=0?epc(e2p()):spc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),spc(0)):epc(e3p())!=0?epc(e3p()):spc(0):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),spc(0)):epc(e4p())!=0?epc(e4p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),0):epc(v16):ls1(epc(tev(v26=e4p())))!=0?mix(epc(v26),0):epc(v26):(v30=e1p())!=0?ls1(epc(tev(v30)))!=0?mix(epc(v30),spc(0)):(v37=epc(v30))!=0?v37:spc(0):(v39=e2p())!=0?ls1(epc(tev(v39)))!=0?mix(epc(v39),spc(0)):(v46=epc(v39))!=0?v46:spc(0):(v48=e3p())!=0?ls1(epc(tev(v48)))!=0?mix(epc(v48),spc(0)):(v55=epc(v48))!=0?v55:spc(0):ls1(epc(tev(v60=e4p())))!=0?mix(epc(v60),spc(0)):(v64=epc(v60))!=0?v64:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),spc(0)):(q=epc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),spc(0))):(q=epc(p))!=0?cto(q):spo(0)
  TE4s_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                VideoController.vcnPal16TS[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    VideoController.vcnPal16TS[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4s_XHCT

  //================================================================================
  //TE4s_XHCG ($0000,$21xx,$1A2F)
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラーが0でないとき
  //                  3番目のカラー
  //                さもなくば(3番目のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //              さもなくば(4番目のパレットが偶数のとき)
  //                4番目のカラーが0でないとき
  //                  4番目のカラー
  //                さもなくば(4番目のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(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(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):(epc(e2p())!=0?epc(e2p()):spc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):spc(0)):(epc(e3p())!=0?epc(e3p()):spc(0)))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):spc(0)):(epc(e4p())!=0?epc(e4p()):spc(0))))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p()):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(0):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())!=0?epc(e2p()):spc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1)!=0?epc(1):spc(0):epc(e3p())!=0?epc(e3p()):spc(0):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1)!=0?epc(1):spc(0):epc(e4p())!=0?epc(e4p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):(v24=e3p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(1)):ls1(v24)!=0?epc(1):epc(v24):ls1(v34=epc(tev(v36=e4p())))!=0?mix(v34,epc(1)):ls1(v36)!=0?epc(1):epc(v36):(v42=e1p())!=0?ls1(v44=epc(tev(v42)))!=0?mix(v44,epc(tod(e2q()))):ls1(v42)!=0?(v51=epc(tod(e2q())))!=0?v51:spc(0):(v55=epc(v42))!=0?v55:spc(0):(v57=e2p())!=0?ls1(v59=epc(tev(v57)))!=0?mix(v59,epc(tod(e2q()))):(v65=epc(v57))!=0?v65:spc(0):(v67=e3p())!=0?ls1(v69=epc(tev(v67)))!=0?mix(v69,epc(1)):ls1(v67)!=0?(v74=epc(1))!=0?v74:spc(0):(v76=epc(v67))!=0?v76:spc(0):ls1(v79=epc(tev(v81=e4p())))!=0?mix(v79,epc(1)):ls1(v81)!=0?(v85=epc(1))!=0?v85:spc(0):(v87=epc(v81))!=0?v87:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?(p=epc(1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?(p=epc(1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(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(0):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(q=epc(p))!=0?cto(q):spo(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?(p=epc(1))!=0?cto(p):spo(0):(q=epc(p))!=0?cto(q):spo(0):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?(p=epc(1))!=0?cto(p):spo(0):(p=epc(q))!=0?cto(p):spo(0)
  TE4s_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0] :
                            (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[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0] :
                                (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[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4s_XHCG

  //================================================================================
  //TE4s_XHCGT ($0000,$21xx,$1B2F)
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0でないとき
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //            スプライトパレット0のカラー(0は黒)
  //          を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //            さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラーが0でないとき
  //              1番目のカラー
  //            さもなくば(1番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが0のとき)
  //        2番目のパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらに
  //              スプライトパレット0のカラー(0は黒)
  //            を混ぜたカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            2番目のカラーが0でないとき
  //              2番目のカラー
  //            さもなくば(2番目のカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットが0のとき)
  //          3番目のパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //                スプライトパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラーが0でないとき
  //                  3番目のカラー
  //                さもなくば(3番目のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらに
  //                スプライトパレット0のカラー(0は黒)
  //              を混ぜたカラー(0は黒)
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              4番目のパレットが奇数のとき
  //                パレット1のカラーが0でないとき
  //                  パレット1のカラー
  //                さもなくば(パレット1のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //              さもなくば(4番目のパレットが偶数のとき)
  //                4番目のカラーが0でないとき
  //                  4番目のカラー
  //                さもなくば(4番目のカラーが0のとき)
  //                  スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):(ls1(e1p())!=0?(epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0)):(epc(e1p())!=0?epc(e1p()):spc(0)))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(0)):(epc(e2p())!=0?epc(e2p()):spc(0))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),spc(0)):(ls1(e3p())!=0?(epc(1)!=0?epc(1):spc(0)):(epc(e3p())!=0?epc(e3p()):spc(0)))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),spc(0)):(ls1(e4p())!=0?(epc(1)!=0?epc(1):spc(0)):(epc(e4p())!=0?epc(e4p()):spc(0))))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),spc(0)):ls1(e1p())!=0?epc(tod(e2q()))!=0?epc(tod(e2q())):spc(0):epc(e1p())!=0?epc(e1p()):spc(0):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),spc(0)):epc(e2p())!=0?epc(e2p()):spc(0):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),spc(0)):ls1(e3p())!=0?epc(1)!=0?epc(1):spc(0):epc(e3p())!=0?epc(e3p()):spc(0):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),spc(0)):ls1(e4p())!=0?epc(1)!=0?epc(1):spc(0):epc(e4p())!=0?epc(e4p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):(v26=e3p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(1)),0):ls1(v26)!=0?epc(1):epc(v26):ls1(v37=epc(tev(v39=e4p())))!=0?mix(mix(v37,epc(1)),0):ls1(v39)!=0?epc(1):epc(v39):(v46=e1p())!=0?ls1(v48=epc(tev(v46)))!=0?mix(mix(v48,epc(tod(e2q()))),spc(0)):ls1(v46)!=0?(v57=epc(tod(e2q())))!=0?v57:spc(0):(v61=epc(v46))!=0?v61:spc(0):(v63=e2p())!=0?ls1(v65=epc(tev(v63)))!=0?mix(mix(v65,epc(tod(e2q()))),spc(0)):(v73=epc(v63))!=0?v73:spc(0):(v75=e3p())!=0?ls1(v77=epc(tev(v75)))!=0?mix(mix(v77,epc(1)),spc(0)):ls1(v75)!=0?(v84=epc(1))!=0?v84:spc(0):(v86=epc(v75))!=0?v86:spc(0):ls1(v89=epc(tev(v91=e4p())))!=0?mix(mix(v89,epc(1)),spc(0)):ls1(v91)!=0?(v97=epc(1))!=0?v97:spc(0):(v99=epc(v91))!=0?v99:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),spc(0)):ls1(p)!=0?(p=epc(tod(e2q())))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),spc(0)):ls1(p)!=0?(p=epc(1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),spc(0)):ls1(q)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),spc(0)):(p&1)!=0?(p=epc(e2q()|1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),spc(0)):(q=epc(p))!=0?q:spc(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),spc(0)):(p&1)!=0?(p=epc(1))!=0?p:spc(0):(q=epc(p))!=0?q:spc(0):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),spc(0)):(q&1)!=0?(p=epc(1))!=0?p:spc(0):(p=epc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),spc(0))):(p&1)!=0?(p=epc(e2q()|1))!=0?cto(p):spo(0):(q=epc(p))!=0?cto(q):spo(0):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),spc(0))):(q=epc(p))!=0?cto(q):spo(0):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),spc(0))):(p&1)!=0?(p=epc(1))!=0?cto(p):spo(0):(q=epc(p))!=0?cto(q):spo(0):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),spc(0))):(q&1)!=0?(p=epc(1))!=0?cto(p):spo(0):(p=epc(q))!=0?cto(p):spo(0)
  TE4s_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (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[0])] :
                            (p & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                VideoController.vcnPal16TS[0])] :
                            (q & 1) != 0 ?
                            (p = VideoController.vcnPal16G8[1]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (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[0])] :
                                (p & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                ((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[0])] :
                                (q & 1) != 0 ?
                                (p = VideoController.vcnPal16G8[1]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4s_XHCGT

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

  //================================================================================
  //TE4s_XHPG ($0000,$21xx,$1E2F)
  //  概要
  //    TE4s  テキスト＞512ドット16色4プレーン＞スプライト(OFF)
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが0のとき
  //        2番目のパレットを偶数化したパレットが0でないとき
  //          2番目のパレットを偶数化したパレットのカラーが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー
  //          さもなくば(2番目のパレットを偶数化したパレットのカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //          3番目のパレットを偶数化したパレットが0でないとき
  //            3番目のパレットを偶数化したパレットのカラーが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //            4番目のパレットを偶数化したパレットのカラーが0でないとき
  //              4番目のパレットを偶数化したパレットのカラー
  //            さもなくば(4番目のパレットを偶数化したパレットのカラーが0のとき)
  //              スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが1のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(e1p()==0?((tev(e2p()))!=0?(epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0)):((tev(e3p()))!=0?(epc(tev(e3p()))!=0?epc(tev(e3p())):spc(0)):(epc(tev(e4p()))!=0?epc(tev(e4p())):spc(0)))):e1p()==1?(epc(0)!=0?epc(0):spc(0)):ls1(e1p())==0?(epc(e1p())!=0?epc(e1p()):spc(0)):(mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):e1p()==0?tev(e2p())!=0?epc(tev(e2p()))!=0?epc(tev(e2p())):spc(0):tev(e3p())!=0?epc(tev(e3p()))!=0?epc(tev(e3p())):spc(0):epc(tev(e4p()))!=0?epc(tev(e4p())):spc(0):e1p()==1?epc(0)!=0?epc(0):spc(0):ls1(e1p())==0?epc(e1p())!=0?epc(e1p()):spc(0):mix(epc(tev(e1p())),epc(tod(e2q())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q()))):(v21=e1p())==0?(v22=tev(e2p()))!=0?(v24=epc(v22))!=0?v24:spc(0):(v26=tev(e3p()))!=0?(v28=epc(v26))!=0?v28:spc(0):(v30=epc(tev(e4p())))!=0?v30:spc(0):v21==1?(v34=epc(0))!=0?v34:spc(0):ls1(v21)==0?(v37=epc(v21))!=0?v37:spc(0):(v39=mix(epc(tev(v21)),epc(tod(e2q()))))!=0?v39:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(p=e1p())==0?(p=tev(e2p()))!=0?(q=epc(p))!=0?q:spc(0):(p=tev(e3p()))!=0?(q=epc(p))!=0?q:spc(0):(p=epc(tev(e4p())))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):ls1(p)==0?(q=epc(p))!=0?q:spc(0):(q=mix(epc(tev(p)),epc(tod(e2q()))))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?q:spc(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?q:spc(0):(p=epc(e4p()&-2))!=0?p:spc(0):p==1?(p=epc(0))!=0?p:spc(0):(p&1)==0?(q=epc(p))!=0?q:spc(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(p=e1p())==0?(p=e2p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(0):(p=e3p()&-2)!=0?(q=epc(p))!=0?cto(q):spo(0):(p=epc(e4p()&-2))!=0?cto(p):spo(0):p==1?(p=epc(0))!=0?cto(p):spo(0):(p&1)==0?(q=epc(p))!=0?cto(q):spo(0):(q=mix(epc(p&-2),epc(e2q()|1)))!=0?cto(q):spo(0)
  TE4s_XHPG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //4番目のパレットのGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (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[0] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            p == 1 ?
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (q = VideoController.vcnMix2 (
                               VideoController.vcnPal16G8[p & -2],
                               VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (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[0] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (p = VideoController.vcnPal16G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                p == 1 ?
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (q = VideoController.vcnMix2 (
                                   VideoController.vcnPal16G8[p & -2],
                                   VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TE4s_XHPG

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

  //================================================================================
  //TF1s ($0001,$21xx,$0023)
  //  概要
  //    TF1s  テキスト＞512ドット256色1プレーン＞スプライト(OFF)
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のカラーが0でないとき
  //        1番目のカラー
  //      さもなくば(1番目のカラーが0のとき)
  //        スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(0)))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:fpc(f1p()):(v4=fpc(f1p()))!=0?v4:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:fpc(f1p()):(p=fpc(f1p()))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):fpo(f1p()):(p=fpc(f1p()))!=0?cto(p):spo(0)
  TF1s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                        GraphicScreen.graM4[gy1st | gx1st & 511])] :
                            (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                             GraphicScreen.graM4[gy1st | gx1st & 511])]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 1 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 1 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 2 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 2 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 3 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 3 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 4 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 4 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 5 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 5 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 6 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 6 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gy1st | gx1st + 7 & 511])] :
                                (p = VideoController.vcnPal16G8[(GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                 GraphicScreen.graM4[gy1st | gx1st + 7 & 511])]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1s

  //================================================================================
  //XTF1s
  //  概要
  //    TF1s  テキスト＞512ドット256色1プレーン＞スプライト(OFF)
  //    拡張あり
  XTF1s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TF1s_XWC
      case 0b00010001:  //TF1s_XWC
      case 0b00010010:  //TF1s_XWC
      case 0b00010011:  //TF1s_XWC
        TF1s_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TF1s_XWP
      case 0b00010101:  //TF1s_XWP
      case 0b00010110:  //TF1s_XWP
      case 0b00010111:  //TF1s_XWP
        TF1s_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TF1s_XHC
        TF1s.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TF1s_XHCT
        TF1s_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TF1s_XHCG
        TF1s_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TF1s_XHCGT
        TF1s_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TF1s_XHPT
        TF1s_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TF1s_XHPG
        TF1s_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TF1s_XHPGT
        TF1s_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TF1s_A
      case 0b01000001:  //TF1s_A
      case 0b01000010:  //TF1s_A
      case 0b01000011:  //TF1s_A
      case 0b01000100:  //TF1s_A
      case 0b01000101:  //TF1s_A
      case 0b01000110:  //TF1s_A
      case 0b01000111:  //TF1s_A
      case 0b01001000:  //TF1s_A
      case 0b01001001:  //TF1s_A
      case 0b01001010:  //TF1s_A
      case 0b01001011:  //TF1s_A
      case 0b01001100:  //TF1s_A
      case 0b01001101:  //TF1s_A
      case 0b01001110:  //TF1s_A
      case 0b01001111:  //TF1s_A
      case 0b01010000:  //TF1s_A
      case 0b01010001:  //TF1s_A
      case 0b01010010:  //TF1s_A
      case 0b01010011:  //TF1s_A
      case 0b01010100:  //TF1s_A
      case 0b01010101:  //TF1s_A
      case 0b01010110:  //TF1s_A
      case 0b01010111:  //TF1s_A
      case 0b01011000:  //TF1s_A
      case 0b01011001:  //TF1s_A
      case 0b01011010:  //TF1s_A
      case 0b01011011:  //TF1s_A
      case 0b01011100:  //TF1s_A
      case 0b01011101:  //TF1s_A
      case 0b01011110:  //TF1s_A
      case 0b01011111:  //TF1s_A
        F1_A.drawRaster (src, dst, rh);
        break;
      default:
        TF1s.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTF1s);
      }  //switch
    }  //drawRaster
  },  //XTF1s

  //================================================================================
  //TF1s_XWC ($0001,$21xx,$1023)
  //  概要
  //    TF1s  テキスト＞512ドット256色1プレーン＞スプライト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //      1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(0))))
  //  中間コード2
  //    ls1(fpc(tev(f1p())))!=0?fpc(f1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(0)
  //  中間コード3
  //    ls1(fpc(tev(v3=f1p())))!=0?fpc(v3):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:fpc(v3):(v8=fpc(v3))!=0?v8:spc(0)
  //  中間コード4
  //    ls1(fpc(tev(p=f1p())))!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0)
  //  中間コード5
  //    (fpc((p=f1p())&-2)&1)!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0)
  //  中間コード6
  //    (fpc((p=f1p())&-2)&1)!=0?fpo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(0)
  TF1s_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1s_XWC

  //================================================================================
  //TF1s_XWP ($0001,$21xx,$1423)
  //  概要
  //    TF1s  テキスト＞512ドット256色1プレーン＞スプライト(OFF)
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが1以下のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (f1p()<=1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(0)):(fpc(0)!=0?fpc(0):spc(0))):ls1(f1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(0))):fpc(tev(f1p())))
  //  中間コード2
  //    f1p()<=1?txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(0):fpc(0)!=0?fpc(0):spc(0):ls1(f1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(0):fpc(tev(f1p()))
  //  中間コード3
  //    (v0=f1p())<=1?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:fpc(0):(v4=fpc(0))!=0?v4:spc(0):ls1(v0)==0?(v7=txp())!=0?(v8=tpc(v7))!=0?v8:fpc(v0):(v10=fpc(v0))!=0?v10:spc(0):fpc(tev(v0))
  //  中間コード4
  //    (p=f1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:spc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0):fpc(tev(p))
  //  中間コード5
  //    (p=f1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?q:fpc(0):(p=fpc(0))!=0?p:spc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0):fpc(p&-2)
  //  中間コード6
  //    (p=f1p())<=1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):fpo(0):(p=fpc(0))!=0?cto(p):spo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(0):fpo(p&-2)
  TF1s_XWP {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) <= 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16G8[0]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) <= 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) <= 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) <= 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) <= 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) <= 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) <= 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                      GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) <= 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16G8[0]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPal32G8[p & -2]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1s_XWP

  //================================================================================
  //TF1s_XHCT ($0001,$21xx,$1923)
  //  概要
  //    TF1s  テキスト＞512ドット256色1プレーン＞スプライト(OFF)
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラーと
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()))):(ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(0)):(fpc(f1p())!=0?fpc(f1p()):spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),0):fpc(f1p()):ls1(fpc(tev(f1p())))!=0?mix(fpc(f1p()),spc(0)):fpc(f1p())!=0?fpc(f1p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(fpc(tev(v5=f1p())))!=0?mix(fpc(v5),0):fpc(v5):ls1(fpc(tev(v12=f1p())))!=0?mix(fpc(v12),spc(0)):(v16=fpc(v12))!=0?v16:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),0):fpc(p):ls1(fpc(tev(p=f1p())))!=0?mix(fpc(p),spc(0)):(q=fpc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),0):fpc(p):(fpc((p=f1p())&-2)&1)!=0?mix(fpc(p),spc(0)):(q=fpc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),0)):fpo(p):(fpc((p=f1p())&-2)&1)!=0?cto(mix(fpc(p),spc(0))):(q=fpc(p))!=0?cto(q):spo(0)
  TF1s_XHCT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                              GraphicScreen.graM4[gy1st | gx1st & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (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[0])] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (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[0])] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1s_XHCT

  //================================================================================
  //TF1s_XHCG ($0001,$21xx,$1A23)
  //  概要
  //    TF1s  テキスト＞512ドット256色1プレーン＞スプライト(OFF)
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //        さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          1番目のパレットが奇数のとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //          さもなくば(1番目のパレットが偶数のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        1番目のパレットが奇数のとき
  //          2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0でないとき
  //            2番目(ONとみなす)のパレットを奇数化したパレットのカラー
  //          さもなくば(2番目(ONとみなす)のパレットを奇数化したパレットのカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //        さもなくば(1番目のパレットが偶数のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p())))):(ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):(ls1(f1p())!=0?(fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(0)):(fpc(f1p())!=0?fpc(f1p()):spc(0)))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q())):fpc(f1p()):ls1(fpc(tev(f1p())))!=0?mix(fpc(tev(f1p())),fpc(tod(f2q()))):ls1(f1p())!=0?fpc(tod(f2q()))!=0?fpc(tod(f2q())):spc(0):fpc(f1p())!=0?fpc(f1p()):spc(0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:ls1(v3=fpc(tev(v5=f1p())))!=0?mix(v3,fpc(tod(f2q()))):ls1(v5)!=0?fpc(tod(f2q())):fpc(v5):ls1(v16=fpc(tev(v18=f1p())))!=0?mix(v16,fpc(tod(f2q()))):ls1(v18)!=0?(v24=fpc(tod(f2q())))!=0?v24:spc(0):(v28=fpc(v18))!=0?v28:spc(0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?fpc(tod(f2q())):fpc(q):ls1(p=fpc(tev(q=f1p())))!=0?mix(p,fpc(tod(f2q()))):ls1(q)!=0?(p=fpc(tod(f2q())))!=0?p:spc(0):(p=fpc(q))!=0?p:spc(0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?fpc(f2q()|1):fpc(q):((p=fpc((q=f1p())&-2))&1)!=0?mix(p,fpc(f2q()|1)):(q&1)!=0?(p=fpc(f2q()|1))!=0?p:spc(0):(p=fpc(q))!=0?p:spc(0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?fpo(f2q()|1):fpo(q):((p=fpc((q=f1p())&-2))&1)!=0?cto(mix(p,fpc(f2q()|1))):(q&1)!=0?(p=fpc(f2q()|1))!=0?cto(p):spo(0):(p=fpc(q))!=0?cto(p):spo(0)
  TF1s_XHCG {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                                                   GraphicScreen.graM4[gy1st | gx1st & 511])) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th & 511] << 4 |
                                                        GraphicScreen.graM4[gz3rd | gx3rd & 511]) | 1] :
                            VideoController.vcnPal32G8[q] :
                            ((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[0] :
                            (p = VideoController.vcnPal16G8[q]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 1 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 1 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 1 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 2 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 2 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 2 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 3 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 3 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 3 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 4 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 4 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 4 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 5 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 5 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 5 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 6 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 6 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 6 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                ((p = VideoController.vcnPal16G8[(q = (GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] << 4 |
                                                                       GraphicScreen.graM4[gy1st | gx1st + 7 & 511])) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                                GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[(GraphicScreen.graM4[gz4th | gx4th + 7 & 511] << 4 |
                                                            GraphicScreen.graM4[gz3rd | gx3rd + 7 & 511]) | 1] :
                                VideoController.vcnPal32G8[q] :
                                ((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[0] :
                                (p = VideoController.vcnPal16G8[q]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF1s_XHCG

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

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

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

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

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

  //================================================================================
  //XTF2s
  //  概要
  //    TF2s  テキスト＞512ドット256色2プレーン＞スプライト(OFF)
  //    拡張あり
  XTF2s {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TF2s_XWC
      case 0b00010001:  //TF2s_XWC
      case 0b00010010:  //TF2s_XWC
      case 0b00010011:  //TF2s_XWC
        TF2s_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TF2s_XWP
      case 0b00010101:  //TF2s_XWP
      case 0b00010110:  //TF2s_XWP
      case 0b00010111:  //TF2s_XWP
        TF2s_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TF2s_XHC
        TF2s.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TF2s_XHCT
        TF2s_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TF2s_XHCG
        TF2s_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TF2s_XHCGT
        TF2s_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TF2s_XHPT
        TF2s_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TF2s_XHPG
        TF2s_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TF2s_XHPGT
        TF2s_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TF2s_A
      case 0b01000001:  //TF2s_A
      case 0b01000010:  //TF2s_A
      case 0b01000011:  //TF2s_A
      case 0b01000100:  //TF2s_A
      case 0b01000101:  //TF2s_A
      case 0b01000110:  //TF2s_A
      case 0b01000111:  //TF2s_A
      case 0b01001000:  //TF2s_A
      case 0b01001001:  //TF2s_A
      case 0b01001010:  //TF2s_A
      case 0b01001011:  //TF2s_A
      case 0b01001100:  //TF2s_A
      case 0b01001101:  //TF2s_A
      case 0b01001110:  //TF2s_A
      case 0b01001111:  //TF2s_A
      case 0b01010000:  //TF2s_A
      case 0b01010001:  //TF2s_A
      case 0b01010010:  //TF2s_A
      case 0b01010011:  //TF2s_A
      case 0b01010100:  //TF2s_A
      case 0b01010101:  //TF2s_A
      case 0b01010110:  //TF2s_A
      case 0b01010111:  //TF2s_A
      case 0b01011000:  //TF2s_A
      case 0b01011001:  //TF2s_A
      case 0b01011010:  //TF2s_A
      case 0b01011011:  //TF2s_A
      case 0b01011100:  //TF2s_A
      case 0b01011101:  //TF2s_A
      case 0b01011110:  //TF2s_A
      case 0b01011111:  //TF2s_A
        F2_A.drawRaster (src, dst, rh);
        break;
      default:
        TF2s.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTF2s);
      }  //switch
    }  //drawRaster
  },  //XTF2s

  //================================================================================
  //TF2s_XWC ($0001,$21xx,$102F)
  //  概要
  //    TF2s  テキスト＞512ドット256色2プレーン＞スプライト(OFF)
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          1番目のカラーが0でないとき
  //            1番目のカラー
  //          さもなくば(1番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            2番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          2番目のカラーが0でないとき
  //            2番目のカラー
  //          さもなくば(2番目のカラーが0のとき)
  //            スプライトパレット0のカラー(0は黒)
  //  中間コード1
  //    (f1p()!=0?(ls1(fpc(tev(f1p())))!=0?fpc(f1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f1p())):(fpc(f1p())!=0?fpc(f1p()):spc(0)))):(ls1(fpc(tev(f2p())))!=0?fpc(f2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):fpc(f2p())):(fpc(f2p())!=0?fpc(f2p()):spc(0)))))
  //  中間コード2
  //    f1p()!=0?ls1(fpc(tev(f1p())))!=0?fpc(f1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f1p()):fpc(f1p())!=0?fpc(f1p()):spc(0):ls1(fpc(tev(f2p())))!=0?fpc(f2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):fpc(f2p()):fpc(f2p())!=0?fpc(f2p()):spc(0)
  //  中間コード3
  //    (v0=f1p())!=0?ls1(fpc(tev(v0)))!=0?fpc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:fpc(v0):(v8=fpc(v0))!=0?v8:spc(0):ls1(fpc(tev(v13=f2p())))!=0?fpc(v13):(v15=txp())!=0?(v16=tpc(v15))!=0?v16:fpc(v13):(v18=fpc(v13))!=0?v18:spc(0)
  //  中間コード4
  //    (p=f1p())!=0?ls1(fpc(tev(p)))!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0):ls1(fpc(tev(p=f2p())))!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0)
  //  中間コード5
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0):(fpc((p=f2p())&-2)&1)!=0?fpc(p):(q=txp())!=0?(r=tpc(q))!=0?r:fpc(p):(q=fpc(p))!=0?q:spc(0)
  //  中間コード6
  //    (p=f1p())!=0?(fpc(p&-2)&1)!=0?fpo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(0):(fpc((p=f2p())&-2)&1)!=0?fpo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):fpo(p):(q=fpc(p))!=0?cto(q):spo(0)
  TF2s_XWC {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのbit3-0のGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //1番目のパレットのbit7-4のGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //2番目のパレットのbit3-0のGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 6 & 3;  //2番目のパレットのbit7-4のGVRAMページ番号
      int gx4th = CRTC.crtR12GrXCurr[pn];
      int gy4th = VideoController.vcnVisible4th + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = (GraphicScreen.graM4[gy2nd | gx2nd & 511] << 4 |
                                  GraphicScreen.graM4[gy1st | gx1st & 511])) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0] :
                            (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th & 511] << 4 |
                                                              GraphicScreen.graM4[gy3rd | gx3rd & 511])) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16G8[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32TS[0]);
          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 = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 1 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 2 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 3 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 4 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 5 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 6 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          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 = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                (VideoController.vcnPal16G8[(p = (GraphicScreen.graM4[gy4th | gx4th + 7 & 511] << 4 |
                                                                  GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511])) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16G8[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0]);
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TF2s_XWC

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  //================================================================================
  //TJs_XHPT ($0007,$21xx,$1D30)
  //  概要
  //    TJs  テキスト＞1024ドット65536色1プレーン＞スプライト(OFF)
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが1以下のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      1番目のパレットが1以下のとき
  //        グラフィックパレット0のカラーが0でないとき
  //          グラフィックパレット0のカラー
  //        さもなくば(グラフィックパレット0のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      1番目のパレットが2以上の偶数のとき
  //        1番目のカラーが0でないとき
  //          1番目のカラー
  //        さもなくば(1番目のカラーが0のとき)
  //          スプライトパレット0のカラー(0は黒)
  //      さもなくば(1番目のパレットが3以上の奇数のとき)
  //        1番目のパレットを偶数化したパレットのカラーと
  //          スプライトパレット0のカラー(0は黒)
  //        を混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0))):(j1p()<=1?(jpc(0,0)!=0?jpc(0,0):spc(0)):ls1(j1p())==0?(jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(0)):mix(jpc(tev(j1p()),tev(j1p())),spc(0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):j1p()<=1?jpc(0,0):ls1(j1p())==0?jpc(j1p(),j1p()):mix(jpc(tev(j1p()),tev(j1p())),0):j1p()<=1?jpc(0,0)!=0?jpc(0,0):spc(0):ls1(j1p())==0?jpc(j1p(),j1p())!=0?jpc(j1p(),j1p()):spc(0):mix(jpc(tev(j1p()),tev(j1p())),spc(0))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=j1p())<=1?jpc(0,0):ls1(v2)==0?jpc(v2,v2):mix(jpc(v8=tev(v2),v8),0):(v9=j1p())<=1?(v10=jpc(0,0))!=0?v10:spc(0):ls1(v9)==0?(v13=jpc(v9,v9))!=0?v13:spc(0):mix(jpc(v17=tev(v9),v17),spc(0))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=j1p())<=1?jpc(0,0):ls1(p)==0?jpc(p,p):mix(jpc(q=tev(p),q),0):(p=j1p())<=1?(p=jpc(0,0))!=0?p:spc(0):ls1(p)==0?(q=jpc(p,p))!=0?q:spc(0):mix(jpc(q=tev(p),q),spc(0))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=j1p())<=1?jpc(0,0):(p&1)==0?jpc(p,p):mix(jpc(q=p&-2,q),0):(p=j1p())<=1?(p=jpc(0,0))!=0?p:spc(0):(p&1)==0?(q=jpc(p,p))!=0?q:spc(0):mix(jpc(q=p&-2,q),spc(0))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=j1p())<=1?jpo(0,0):(p&1)==0?jpo(p,p):cto(mix(jpc(q=p&-2,q),0)):(p=j1p())<=1?(p=jpc(0,0))!=0?cto(p):spo(0):(p&1)==0?(q=jpc(p,p))!=0?cto(q):spo(0):cto(mix(jpc(q=p&-2,q),spc(0)))
  TJs_XHPT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int gx = CRTC.crtR12GrXCurr[0];  //1024ドットx座標。溢れは無視する
      int gy = CRTC.crtR13GrYZero[0] + src;  //1024ドットy座標。溢れは無視する
      int ga0 = ((gy & 511) << 9);  //x=0,y&=511の1024ドットアドレス
      int gt = VideoController.vcnReg2Curr >> (gy >> 7 & 4);  //y<512?G2nd|G1st:G4th|G3rd
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        gx += half;
        da += half;
      }
      int ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18) + (gx & 511);  //1024ドットアドレス
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                              (q = VideoController.vcnPal16TS[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                      VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                      VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                      VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[0])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                               ts=1のとき
        int tt = ts + 8;                                               //tt=9
        ts += 16;                                                      //ts=17
        //                                                               ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                     //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          int dw = Math.min (db - da, (512 - (gx & 511)) & -8);  //今回の幅。8の倍数
          gx += dw;  //次回の1024ドットx座標
          int dc = da + dw;  //今回のARGB出力インデックスの終了位置
          while (da < dc) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            int p, q;
            XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                              (q = VideoController.vcnPal16TS[p]) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[0 >> 8] |
                                VideoController.vcnPal8G16L[0 & 255]] :
                              (p & 1) == 0 ?
                              VideoController.vcnPalTbl[
                                VideoController.vcnPal8G16H[p >> 8] |
                                VideoController.vcnPal8G16L[p & 255]] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  0)] :
                              (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                    GraphicScreen.graM4[ga + 2097152] << 8 |
                                    GraphicScreen.graM4[ga + 1048576] << 4 |
                                    GraphicScreen.graM4[ga])) <= 1 ?
                              (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                              VideoController.vcnPalTbl[p] :
                              VideoController.vcnPal32TS[0] :
                              (p & 1) == 0 ?
                              (q = (VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255])) != 0 ?
                              VideoController.vcnPalTbl[q] :
                              VideoController.vcnPal32TS[0] :
                              VideoController.vcnPalTbl[
                                VideoController.vcnMix2 (
                                  (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                   VideoController.vcnPal8G16L[q & 255]),
                                  VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145729] << 12 |
                                        GraphicScreen.graM4[ga + 2097153] << 8 |
                                        GraphicScreen.graM4[ga + 1048577] << 4 |
                                        GraphicScreen.graM4[ga + 1])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145730] << 12 |
                                        GraphicScreen.graM4[ga + 2097154] << 8 |
                                        GraphicScreen.graM4[ga + 1048578] << 4 |
                                        GraphicScreen.graM4[ga + 2])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145731] << 12 |
                                        GraphicScreen.graM4[ga + 2097155] << 8 |
                                        GraphicScreen.graM4[ga + 1048579] << 4 |
                                        GraphicScreen.graM4[ga + 3])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145732] << 12 |
                                        GraphicScreen.graM4[ga + 2097156] << 8 |
                                        GraphicScreen.graM4[ga + 1048580] << 4 |
                                        GraphicScreen.graM4[ga + 4])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145733] << 12 |
                                        GraphicScreen.graM4[ga + 2097157] << 8 |
                                        GraphicScreen.graM4[ga + 1048581] << 4 |
                                        GraphicScreen.graM4[ga + 5])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145734] << 12 |
                                        GraphicScreen.graM4[ga + 2097158] << 8 |
                                        GraphicScreen.graM4[ga + 1048582] << 4 |
                                        GraphicScreen.graM4[ga + 6])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                  (q = VideoController.vcnPal16TS[p]) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[0 >> 8] |
                                    VideoController.vcnPal8G16L[0 & 255]] :
                                  (p & 1) == 0 ?
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnPal8G16H[p >> 8] |
                                    VideoController.vcnPal8G16L[p & 255]] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      0)] :
                                  (p = (GraphicScreen.graM4[ga + 3145735] << 12 |
                                        GraphicScreen.graM4[ga + 2097159] << 8 |
                                        GraphicScreen.graM4[ga + 1048583] << 4 |
                                        GraphicScreen.graM4[ga + 7])) <= 1 ?
                                  (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                        VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                  VideoController.vcnPalTbl[p] :
                                  VideoController.vcnPal32TS[0] :
                                  (p & 1) == 0 ?
                                  (q = (VideoController.vcnPal8G16H[p >> 8] |
                                        VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                  VideoController.vcnPalTbl[q] :
                                  VideoController.vcnPal32TS[0] :
                                  VideoController.vcnPalTbl[
                                    VideoController.vcnMix2 (
                                      (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                       VideoController.vcnPal8G16L[q & 255]),
                                      VideoController.vcnPal16TS[0])]);
            ga += 8;
            da += 8;
          }  //while da<dc
          if (da < db) {
            //                                                           ........ ........ .1234567 ________  p0>>tt
            //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
            p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
            p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
            p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
            p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
            int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                      VideoController.VCN_TXP2[p2 >>> 24] |
                      VideoController.VCN_TXP1[p1 >>> 24] |
                      VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
            tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
            for (int k = 0; k < 8; k++) {
              if ((gx & 511) == 0) {  //gxが512の倍数のとき
                ga = ga0 + ((gt >> (gx >> 8 & 2) & 3) << 18);  //gaを再計算する
              }
              gx++;
              int p, q;
              XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[0 >> 8] |
                                  VideoController.vcnPal8G16L[0 & 255]] :
                                (p & 1) == 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnPal8G16H[p >> 8] |
                                  VideoController.vcnPal8G16L[p & 255]] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    0)] :
                                (p = (GraphicScreen.graM4[ga + 3145728] << 12 |
                                      GraphicScreen.graM4[ga + 2097152] << 8 |
                                      GraphicScreen.graM4[ga + 1048576] << 4 |
                                      GraphicScreen.graM4[ga])) <= 1 ?
                                (p = (VideoController.vcnPal8G16H[0 >> 8] |
                                      VideoController.vcnPal8G16L[0 & 255])) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32TS[0] :
                                (p & 1) == 0 ?
                                (q = (VideoController.vcnPal8G16H[p >> 8] |
                                      VideoController.vcnPal8G16L[p & 255])) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32TS[0] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    (VideoController.vcnPal8G16H[(q = p & -2) >> 8] |
                                     VideoController.vcnPal8G16L[q & 255]),
                                    VideoController.vcnPal16TS[0])]);
              tp <<= 4;
              ga++;
              da++;
            }  //for k
          }  //if da<db
        }  //while da<db
        ts -= 16;                                                      //ts=1
      }  //if ts==0
    }  //drawRaster
  },  //TJs_XHPT

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

  //================================================================================
  //XTSE1
  //  概要
  //    TSE1  テキスト＞スプライト＞512ドット16色1プレーン
  //    拡張あり
  XTSE1 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TSE1_XWC
      case 0b00010001:  //TSE1_XWC
      case 0b00010010:  //TSE1_XWC
      case 0b00010011:  //TSE1_XWC
        TSE1_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TSE1_XWP
      case 0b00010101:  //TSE1_XWP
      case 0b00010110:  //TSE1_XWP
      case 0b00010111:  //TSE1_XWP
        TSE1_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TSE1_XHC
        TSE1.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TSE1_XHCT
        TSE1_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TSE1_XHCG
        TSE1_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TSE1_XHCGT
        TSE1_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TSE1_XHPT
        TSE1_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TSE1_XHPG
        TSE1_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TSE1_XHPGT
        TSE1_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TSE1_A
      case 0b01000001:  //TSE1_A
      case 0b01000010:  //TSE1_A
      case 0b01000011:  //TSE1_A
      case 0b01000100:  //TSE1_A
      case 0b01000101:  //TSE1_A
      case 0b01000110:  //TSE1_A
      case 0b01000111:  //TSE1_A
      case 0b01001000:  //TSE1_A
      case 0b01001001:  //TSE1_A
      case 0b01001010:  //TSE1_A
      case 0b01001011:  //TSE1_A
      case 0b01001100:  //TSE1_A
      case 0b01001101:  //TSE1_A
      case 0b01001110:  //TSE1_A
      case 0b01001111:  //TSE1_A
      case 0b01010000:  //TSE1_A
      case 0b01010001:  //TSE1_A
      case 0b01010010:  //TSE1_A
      case 0b01010011:  //TSE1_A
      case 0b01010100:  //TSE1_A
      case 0b01010101:  //TSE1_A
      case 0b01010110:  //TSE1_A
      case 0b01010111:  //TSE1_A
      case 0b01011000:  //TSE1_A
      case 0b01011001:  //TSE1_A
      case 0b01011010:  //TSE1_A
      case 0b01011011:  //TSE1_A
      case 0b01011100:  //TSE1_A
      case 0b01011101:  //TSE1_A
      case 0b01011110:  //TSE1_A
      case 0b01011111:  //TSE1_A
        E1_A.drawRaster (src, dst, rh);
        break;
      default:
        TSE1.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTSE1);
      }  //switch
    }  //drawRaster
  },  //XTSE1

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

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

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

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

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

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

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

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

  //================================================================================
  //TSE2 ($0000,$12xx,$0063)
  //  概要
  //    TSE2  テキスト＞スプライト＞512ドット16色2プレーン
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):epc(e2p()))):(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):epc(e2p()))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):epc(e2p()):spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):epc(e2p())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):epc(e2p()):(v6=spc(spp()))!=0?v6:(v8=e1p())!=0?epc(v8):epc(e2p())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):epc(e2p()):(p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):epc(e2p())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?epo(p):epo(e2p()):(p=spc(spp()))!=0?cto(p):(p=e1p())!=0?epo(p):epo(e2p())
  TSE2 {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE2

  //================================================================================
  //XTSE2
  //  概要
  //    TSE2  テキスト＞スプライト＞512ドット16色2プレーン
  //    拡張あり
  XTSE2 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TSE2_XWC
      case 0b00010001:  //TSE2_XWC
      case 0b00010010:  //TSE2_XWC
      case 0b00010011:  //TSE2_XWC
        TSE2_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TSE2_XWP
      case 0b00010101:  //TSE2_XWP
      case 0b00010110:  //TSE2_XWP
      case 0b00010111:  //TSE2_XWP
        TSE2_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TSE2_XHC
        TSE2.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TSE2_XHCT
        TSE2_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TSE2_XHCG
        TSE2_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TSE2_XHCGT
        TSE2_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TSE2_XHPT
        TSE2_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TSE2_XHPG
        TSE2_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TSE2_XHPGT
        TSE2_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TSE2_A
      case 0b01000001:  //TSE2_A
      case 0b01000010:  //TSE2_A
      case 0b01000011:  //TSE2_A
      case 0b01000100:  //TSE2_A
      case 0b01000101:  //TSE2_A
      case 0b01000110:  //TSE2_A
      case 0b01000111:  //TSE2_A
      case 0b01001000:  //TSE2_A
      case 0b01001001:  //TSE2_A
      case 0b01001010:  //TSE2_A
      case 0b01001011:  //TSE2_A
      case 0b01001100:  //TSE2_A
      case 0b01001101:  //TSE2_A
      case 0b01001110:  //TSE2_A
      case 0b01001111:  //TSE2_A
      case 0b01010000:  //TSE2_A
      case 0b01010001:  //TSE2_A
      case 0b01010010:  //TSE2_A
      case 0b01010011:  //TSE2_A
      case 0b01010100:  //TSE2_A
      case 0b01010101:  //TSE2_A
      case 0b01010110:  //TSE2_A
      case 0b01010111:  //TSE2_A
      case 0b01011000:  //TSE2_A
      case 0b01011001:  //TSE2_A
      case 0b01011010:  //TSE2_A
      case 0b01011011:  //TSE2_A
      case 0b01011100:  //TSE2_A
      case 0b01011101:  //TSE2_A
      case 0b01011110:  //TSE2_A
      case 0b01011111:  //TSE2_A
        E2_A.drawRaster (src, dst, rh);
        break;
      default:
        TSE2.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTSE2);
      }  //switch
    }  //drawRaster
  },  //XTSE2

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

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

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

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

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

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

  //================================================================================
  //TSE2_XHPG ($0000,$12xx,$1E63)
  //  概要
  //    TSE2  テキスト＞スプライト＞512ドット16色2プレーン
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))))):(spc(spp())!=0?spc(spp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p()))):spc(spp())!=0?spc(spp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2p())))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2p()))):(v15=spc(spp()))!=0?v15:(v17=e1p())==0?epc(tev(e2p())):v17==1?epc(0):ls1(v17)==0?epc(v17):mix(epc(tev(v17)),epc(tod(e2p())))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p()))):(p=spc(spp()))!=0?p:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2p())))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1)):(p=spc(spp()))!=0?p:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2p()|1))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1))):(p=spc(spp()))!=0?cto(p):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2p()|1)))
  TSE2_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1])]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1])]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1])]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE2_XHPG

  //================================================================================
  //TSE2_XHPGT ($0000,$12xx,$1F63)
  //  概要
  //    TSE2  テキスト＞スプライト＞512ドット16色2プレーン
  //    XHPGT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0))):(spc(spp())!=0?spc(spp()):(e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0):spc(spp())!=0?spc(spp()):e1p()==0?epc(tev(e2p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(mix(epc(tev(e1p())),epc(tod(e2p()))),0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?epc(tev(e2p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(mix(epc(tev(v2)),epc(tod(e2p()))),0):(v16=spc(spp()))!=0?v16:(v18=e1p())==0?epc(tev(e2p())):v18==1?epc(0):ls1(v18)==0?epc(v18):mix(mix(epc(tev(v18)),epc(tod(e2p()))),0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2p()))),0):(p=spc(spp()))!=0?p:(p=e1p())==0?epc(tev(e2p())):p==1?epc(0):ls1(p)==0?epc(p):mix(mix(epc(tev(p)),epc(tod(e2p()))),0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2p()|1)),0):(p=spc(spp()))!=0?p:(p=e1p())==0?epc(e2p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(mix(epc(p&-2),epc(e2p()|1)),0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2p()|1)),0)):(p=spc(spp()))!=0?cto(p):(p=e1p())==0?epo(e2p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(mix(epc(p&-2),epc(e2p()|1)),0))
  TSE2_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  VideoController.vcnPal16G8[p & -2],
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd & 511] | 1]),
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] | 1]),
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      VideoController.vcnPal16G8[p & -2],
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] | 1]),
                                    0)]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE2_XHPGT

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

  //================================================================================
  //XTSE3
  //  概要
  //    TSE3  テキスト＞スプライト＞512ドット16色3プレーン
  //    拡張あり
  XTSE3 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TSE3_XWC
      case 0b00010001:  //TSE3_XWC
      case 0b00010010:  //TSE3_XWC
      case 0b00010011:  //TSE3_XWC
        TSE3_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TSE3_XWP
      case 0b00010101:  //TSE3_XWP
      case 0b00010110:  //TSE3_XWP
      case 0b00010111:  //TSE3_XWP
        TSE3_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TSE3_XHC
        TSE3.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TSE3_XHCT
        TSE3_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TSE3_XHCG
        TSE3_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TSE3_XHCGT
        TSE3_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TSE3_XHPT
        TSE3_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TSE3_XHPG
        TSE3_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TSE3_XHPGT
        TSE3_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TSE3_A
      case 0b01000001:  //TSE3_A
      case 0b01000010:  //TSE3_A
      case 0b01000011:  //TSE3_A
      case 0b01000100:  //TSE3_A
      case 0b01000101:  //TSE3_A
      case 0b01000110:  //TSE3_A
      case 0b01000111:  //TSE3_A
      case 0b01001000:  //TSE3_A
      case 0b01001001:  //TSE3_A
      case 0b01001010:  //TSE3_A
      case 0b01001011:  //TSE3_A
      case 0b01001100:  //TSE3_A
      case 0b01001101:  //TSE3_A
      case 0b01001110:  //TSE3_A
      case 0b01001111:  //TSE3_A
      case 0b01010000:  //TSE3_A
      case 0b01010001:  //TSE3_A
      case 0b01010010:  //TSE3_A
      case 0b01010011:  //TSE3_A
      case 0b01010100:  //TSE3_A
      case 0b01010101:  //TSE3_A
      case 0b01010110:  //TSE3_A
      case 0b01010111:  //TSE3_A
      case 0b01011000:  //TSE3_A
      case 0b01011001:  //TSE3_A
      case 0b01011010:  //TSE3_A
      case 0b01011011:  //TSE3_A
      case 0b01011100:  //TSE3_A
      case 0b01011101:  //TSE3_A
      case 0b01011110:  //TSE3_A
      case 0b01011111:  //TSE3_A
        E3_A.drawRaster (src, dst, rh);
        break;
      default:
        TSE3.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTSE3);
      }  //switch
    }  //drawRaster
  },  //XTSE3

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

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

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

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

  //================================================================================
  //TSE3_XHCGT ($0000,$12xx,$1B67)
  //  概要
  //    TSE3  テキスト＞スプライト＞512ドット16色3プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              3番目のパレットが奇数のとき
  //                パレット1のカラー(0は黒)
  //              さもなくば(3番目のパレットが偶数のとき)
  //                3番目のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p())))))):(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p())))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):ls1(v27=epc(tev(v29=e3p())))!=0?mix(mix(v27,epc(1)),0):ls1(v29)!=0?epc(1):epc(v29):(v36=spc(spp()))!=0?v36:(v38=e1p())!=0?ls1(v40=epc(tev(v38)))!=0?mix(mix(v40,epc(tod(e2q()))),0):ls1(v38)!=0?epc(tod(e2q())):epc(v38):(v52=e2p())!=0?ls1(v54=epc(tev(v52)))!=0?mix(mix(v54,epc(tod(e2q()))),0):epc(v52):ls1(v63=epc(tev(v65=e3p())))!=0?mix(mix(v63,epc(1)),0):ls1(v65)!=0?epc(1):epc(v65)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):ls1(p=epc(tev(q=e3p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=spc(spp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):((p=epc((q=e3p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=spc(spp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):((p=epc((q=e3p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q)
  TSE3_XHCGT {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      SpriteScreen.sprStep3 ();
      int sx = 16;  //スプライトx座標
      int pn = VideoController.vcnReg2Curr & 3;  //1番目のパレットのGVRAMページ番号
      int gx1st = CRTC.crtR12GrXCurr[pn];
      int gy1st = VideoController.vcnVisible1st + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      pn = VideoController.vcnReg2Curr >> 2 & 3;  //2番目のパレットのGVRAMページ番号
      int gx2nd = CRTC.crtR12GrXCurr[pn];
      int gy2nd = VideoController.vcnVisible2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int gz2nd = VideoController.vcnHidden2nd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);  //ONとみなす
      pn = VideoController.vcnReg2Curr >> 4 & 3;  //3番目のパレットのGVRAMページ番号
      int gx3rd = CRTC.crtR12GrXCurr[pn];
      int gy3rd = VideoController.vcnVisible3rd + ((CRTC.crtR13GrYZero[pn] + src & 511) << 9);
      int ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE3_XHCGT

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

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

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

  //================================================================================
  //TSE4 ($0000,$12xx,$006F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    拡張なし
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):(e3p()!=0?epc(e3p()):epc(e4p()))))):(spc(spp())!=0?spc(spp()):(e1p()!=0?epc(e1p()):(e2p()!=0?epc(e2p()):(e3p()!=0?epc(e3p()):epc(e4p()))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):e3p()!=0?epc(e3p()):epc(e4p()):spc(spp())!=0?spc(spp()):e1p()!=0?epc(e1p()):e2p()!=0?epc(e2p()):e3p()!=0?epc(e3p()):epc(e4p())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?epc(v2):(v4=e2p())!=0?epc(v4):(v6=e3p())!=0?epc(v6):epc(e4p()):(v10=spc(spp()))!=0?v10:(v12=e1p())!=0?epc(v12):(v14=e2p())!=0?epc(v14):(v16=e3p())!=0?epc(v16):epc(e4p())
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p())
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p()):(p=spc(spp()))!=0?p:(p=e1p())!=0?epc(p):(p=e2p())!=0?epc(p):(p=e3p())!=0?epc(p):epc(e4p())
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):(p=e3p())!=0?epo(p):epo(e4p()):(p=spc(spp()))!=0?cto(p):(p=e1p())!=0?epo(p):(p=e2p())!=0?epo(p):(p=e3p())!=0?epo(p):epo(e4p())
  TSE4 {
    @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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511]]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511]]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511]]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511]]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511]]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511]]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511]]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511]]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE4

  //================================================================================
  //XTSE4
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    拡張あり
  XTSE4 {
    @Override public void drawRaster (int src, int dst, boolean rh) {
      switch (VideoController.vcnReg3Curr >>> 8 & 0b01011111) {
        //   .A.XHPGT
      case 0b00010000:  //TSE4_XWC
      case 0b00010001:  //TSE4_XWC
      case 0b00010010:  //TSE4_XWC
      case 0b00010011:  //TSE4_XWC
        TSE4_XWC.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00010100:  //TSE4_XWP
      case 0b00010101:  //TSE4_XWP
      case 0b00010110:  //TSE4_XWP
      case 0b00010111:  //TSE4_XWP
        TSE4_XWP.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011000:  //TSE4_XHC
        TSE4.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011001:  //TSE4_XHCT
        TSE4_XHCT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011010:  //TSE4_XHCG
        TSE4_XHCG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011011:  //TSE4_XHCGT
        TSE4_XHCGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011101:  //TSE4_XHPT
        TSE4_XHPT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011110:  //TSE4_XHPG
        TSE4_XHPG.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b00011111:  //TSE4_XHPGT
        TSE4_XHPGT.drawRaster (src, dst, rh);
        break;
        //   .A.XHPGT
      case 0b01000000:  //TSE4_A
      case 0b01000001:  //TSE4_A
      case 0b01000010:  //TSE4_A
      case 0b01000011:  //TSE4_A
      case 0b01000100:  //TSE4_A
      case 0b01000101:  //TSE4_A
      case 0b01000110:  //TSE4_A
      case 0b01000111:  //TSE4_A
      case 0b01001000:  //TSE4_A
      case 0b01001001:  //TSE4_A
      case 0b01001010:  //TSE4_A
      case 0b01001011:  //TSE4_A
      case 0b01001100:  //TSE4_A
      case 0b01001101:  //TSE4_A
      case 0b01001110:  //TSE4_A
      case 0b01001111:  //TSE4_A
      case 0b01010000:  //TSE4_A
      case 0b01010001:  //TSE4_A
      case 0b01010010:  //TSE4_A
      case 0b01010011:  //TSE4_A
      case 0b01010100:  //TSE4_A
      case 0b01010101:  //TSE4_A
      case 0b01010110:  //TSE4_A
      case 0b01010111:  //TSE4_A
      case 0b01011000:  //TSE4_A
      case 0b01011001:  //TSE4_A
      case 0b01011010:  //TSE4_A
      case 0b01011011:  //TSE4_A
      case 0b01011100:  //TSE4_A
      case 0b01011101:  //TSE4_A
      case 0b01011110:  //TSE4_A
      case 0b01011111:  //TSE4_A
        E4_A.drawRaster (src, dst, rh);
        break;
      default:
        TSE4.drawRaster (src, dst, rh);
        VideoController.vcnReportUnimplemented (XTSE4);
      }  //switch
    }  //drawRaster
  },  //XTSE4

  //================================================================================
  //TSE4_XWC ($0000,$12xx,$106F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    XWC  優先順位に関わらず0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0でないとき
  //      1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //        1番目のカラー(0は黒)
  //      さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //        テキストパレットが0でないとき
  //          テキストカラーが0でないとき
  //            テキストカラー
  //          さもなくば(テキストカラーが0のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(テキストパレットが0のとき)
  //          スプライトカラーが0でないとき
  //            スプライトカラー
  //          さもなくば(スプライトカラーが0のとき)
  //            1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが0のとき)
  //      2番目のパレットが0でないとき
  //        2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //          2番目のカラー(0は黒)
  //        さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //          テキストパレットが0でないとき
  //            テキストカラーが0でないとき
  //              テキストカラー
  //            さもなくば(テキストカラーが0のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(テキストパレットが0のとき)
  //            スプライトカラーが0でないとき
  //              スプライトカラー
  //            さもなくば(スプライトカラーが0のとき)
  //              2番目のカラー(0は黒)
  //      さもなくば(2番目のパレットが0のとき)
  //        3番目のパレットが0でないとき
  //          3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            3番目のカラー(0は黒)
  //          さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストパレットが0でないとき
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                3番目のカラー(0は黒)
  //        さもなくば(3番目のパレットが0のとき)
  //          4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            4番目のカラー(0は黒)
  //          さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            テキストパレットが0でないとき
  //              テキストカラーが0でないとき
  //                テキストカラー
  //              さもなくば(テキストカラーが0のとき)
  //                4番目のカラー(0は黒)
  //            さもなくば(テキストパレットが0のとき)
  //              スプライトカラーが0でないとき
  //                スプライトカラー
  //              さもなくば(スプライトカラーが0のとき)
  //                4番目のカラー(0は黒)
  //  中間コード1
  //    (e1p()!=0?(ls1(epc(tev(e1p())))!=0?epc(e1p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(spc(spp())!=0?spc(spp()):epc(e1p())))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?epc(e2p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e2p())):(spc(spp())!=0?spc(spp()):epc(e2p())))):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?epc(e3p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e3p())):(spc(spp())!=0?spc(spp()):epc(e3p())))):(ls1(epc(tev(e4p())))!=0?epc(e4p()):(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e4p())):(spc(spp())!=0?spc(spp()):epc(e4p())))))))
  //  中間コード2
  //    e1p()!=0?ls1(epc(tev(e1p())))!=0?epc(e1p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):spc(spp())!=0?spc(spp()):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?epc(e2p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e2p()):spc(spp())!=0?spc(spp()):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?epc(e3p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e3p()):spc(spp())!=0?spc(spp()):epc(e3p()):ls1(epc(tev(e4p())))!=0?epc(e4p()):txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e4p()):spc(spp())!=0?spc(spp()):epc(e4p())
  //  中間コード3
  //    (v0=e1p())!=0?ls1(epc(tev(v0)))!=0?epc(v0):(v5=txp())!=0?(v6=tpc(v5))!=0?v6:epc(v0):(v8=spc(spp()))!=0?v8:epc(v0):(v11=e2p())!=0?ls1(epc(tev(v11)))!=0?epc(v11):(v16=txp())!=0?(v17=tpc(v16))!=0?v17:epc(v11):(v19=spc(spp()))!=0?v19:epc(v11):(v22=e3p())!=0?ls1(epc(tev(v22)))!=0?epc(v22):(v27=txp())!=0?(v28=tpc(v27))!=0?v28:epc(v22):(v30=spc(spp()))!=0?v30:epc(v22):ls1(epc(tev(v36=e4p())))!=0?epc(v36):(v38=txp())!=0?(v39=tpc(v38))!=0?v39:epc(v36):(v41=spc(spp()))!=0?v41:epc(v36)
  //  中間コード4
  //    (p=e1p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):ls1(epc(tev(p=e4p())))!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p)
  //  中間コード5
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):(epc((p=e4p())&-2)&1)!=0?epc(p):(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p)
  //  中間コード6
  //    (p=e1p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=spc(spp()))!=0?cto(q):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=spc(spp()))!=0?cto(q):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=spc(spp()))!=0?cto(q):epo(p):(epc((p=e4p())&-2)&1)!=0?epo(p):(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=spc(spp()))!=0?cto(q):epo(p)
  TSE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE4_XWC

  //================================================================================
  //TSE4_XWP ($0000,$12xx,$146F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    XWP  優先順位に関わらず1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーだけ表示する
  //  手順
  //    1番目のパレットが0のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //    1番目のパレットが1のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          グラフィックパレット0のカラー(0は黒)
  //    1番目のパレットが2以上の偶数のとき
  //      テキストパレットが0でないとき
  //        テキストカラーが0でないとき
  //          テキストカラー
  //        さもなくば(テキストカラーが0のとき)
  //          1番目のカラー(0は黒)
  //      さもなくば(テキストパレットが0のとき)
  //        スプライトカラーが0でないとき
  //          スプライトカラー
  //        さもなくば(スプライトカラーが0のとき)
  //          1番目のカラー(0は黒)
  //    さもなくば(1番目のパレットが3以上の奇数のとき)
  //      1番目のパレットを偶数化したパレットのカラー(0は黒)
  //  中間コード1
  //    (e1p()==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p()))))):(spc(spp())!=0?spc(spp()):((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))))):e1p()==1?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(0)):(spc(spp())!=0?spc(spp()):epc(0))):ls1(e1p())==0?(txp()!=0?(tpc(txp())!=0?tpc(txp()):epc(e1p())):(spc(spp())!=0?spc(spp()):epc(e1p()))):epc(tev(e1p())))
  //  中間コード2
  //    e1p()==0?txp()!=0?tpc(txp())!=0?tpc(txp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):spc(spp())!=0?spc(spp()):tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(0):spc(spp())!=0?spc(spp()):epc(0):ls1(e1p())==0?txp()!=0?tpc(txp())!=0?tpc(txp()):epc(e1p()):spc(spp())!=0?spc(spp()):epc(e1p()):epc(tev(e1p()))
  //  中間コード3
  //    (v0=e1p())==0?(v1=txp())!=0?(v2=tpc(v1))!=0?v2:(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):(v12=spc(spp()))!=0?v12:(v14=tev(e2p()))!=0?epc(v14):(v17=tev(e3p()))!=0?epc(v17):epc(tev(e4p())):v0==1?(v23=txp())!=0?(v24=tpc(v23))!=0?v24:epc(0):(v26=spc(spp()))!=0?v26:epc(0):ls1(v0)==0?(v30=txp())!=0?(v31=tpc(v30))!=0?v31:epc(v0):(v33=spc(spp()))!=0?v33:epc(v0):epc(tev(v0))
  //  中間コード4
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):(p=spc(spp()))!=0?p:(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=spc(spp()))!=0?p:epc(0):ls1(p)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):epc(tev(p))
  //  中間コード5
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?q:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):(p=spc(spp()))!=0?p:(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?(p=txp())!=0?(q=tpc(p))!=0?q:epc(0):(p=spc(spp()))!=0?p:epc(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?r:epc(p):(q=spc(spp()))!=0?q:epc(p):epc(p&-2)
  //  中間コード6
  //    (p=e1p())==0?(p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):(p=spc(spp()))!=0?cto(p):(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?(p=txp())!=0?(q=tpc(p))!=0?cto(q):epo(0):(p=spc(spp()))!=0?cto(p):epo(0):(p&1)==0?(q=txp())!=0?(r=tpc(q))!=0?cto(r):epo(p):(q=spc(spp()))!=0?cto(q):epo(p):epo(p&-2)
  TSE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q, r;
          XEiJ.pnlBM[da] = ((p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            (p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[0] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            (q = tp >>> 28) != 0 ?
                            (r = VideoController.vcnPal16TS[q]) != 0 ?
                            VideoController.vcnPalTbl[r] :
                            VideoController.vcnPal32G8[p] :
                            (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 1] = ((p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 24 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 2] = ((p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 20 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 3] = ((p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 16 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 4] = ((p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 12 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 5] = ((p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 8 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 6] = ((p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                (p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp >>> 4 & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          XEiJ.pnlBM[da + 7] = ((p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                (p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[0] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                (q = tp & 15) != 0 ?
                                (r = VideoController.vcnPal16TS[q]) != 0 ?
                                VideoController.vcnPalTbl[r] :
                                VideoController.vcnPal32G8[p] :
                                (q = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[p & -2]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE4_XWP

  //================================================================================
  //TSE4_XHCT ($0000,$12xx,$196F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    XHCT  0でない1番目のパレットを偶数化(65536色は奇数化)したパレットのカラーが奇数のとき0でない1番目のカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のカラーとカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のカラーとカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のカラーとカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))):(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p())):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p())):(ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p()):spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(e1p()),0):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(e2p()),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(e3p()),0):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(e4p()),0):epc(e4p())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(epc(tev(v2)))!=0?mix(epc(v2),0):epc(v2):(v9=e2p())!=0?ls1(epc(tev(v9)))!=0?mix(epc(v9),0):epc(v9):(v16=e3p())!=0?ls1(epc(tev(v16)))!=0?mix(epc(v16),0):epc(v16):ls1(epc(tev(v26=e4p())))!=0?mix(epc(v26),0):epc(v26):(v30=spc(spp()))!=0?v30:(v32=e1p())!=0?ls1(epc(tev(v32)))!=0?mix(epc(v32),0):epc(v32):(v39=e2p())!=0?ls1(epc(tev(v39)))!=0?mix(epc(v39),0):epc(v39):(v46=e3p())!=0?ls1(epc(tev(v46)))!=0?mix(epc(v46),0):epc(v46):ls1(epc(tev(v56=e4p())))!=0?mix(epc(v56),0):epc(v56)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p):(p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?ls1(epc(tev(p)))!=0?mix(epc(p),0):epc(p):ls1(epc(tev(p=e4p())))!=0?mix(epc(p),0):epc(p)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p):(p=spc(spp()))!=0?p:(p=e1p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?mix(epc(p),0):epc(p):(epc((p=e4p())&-2)&1)!=0?mix(epc(p),0):epc(p)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=spc(spp()))!=0?cto(p):(p=e1p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e2p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(p=e3p())!=0?(epc(p&-2)&1)!=0?cto(mix(epc(p),0)):epo(p):(epc((p=e4p())&-2)&1)!=0?cto(mix(epc(p),0)):epo(p)
  TSE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2] & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p],
                                0)] :
                            VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                (VideoController.vcnPal16G8[p & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (VideoController.vcnPal16G8[(p = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2] & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p],
                                    0)] :
                                VideoController.vcnPal32G8[p]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE4_XHCT

  //================================================================================
  //TSE4_XHCG ($0000,$12xx,$1A6F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    XHCG  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):(ls1(e4p())!=0?epc(1):epc(e4p()))))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p()):spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(epc(tev(e1p())),epc(tod(e2q()))):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(epc(tev(e2p())),epc(tod(e2q()))):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(epc(tev(e3p())),epc(1)):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(epc(tev(e4p())),epc(1)):ls1(e4p())!=0?epc(1):epc(e4p())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(v4,epc(tod(e2q()))):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v15=e2p())!=0?ls1(v17=epc(tev(v15)))!=0?mix(v17,epc(tod(e2q()))):epc(v15):(v24=e3p())!=0?ls1(v26=epc(tev(v24)))!=0?mix(v26,epc(1)):ls1(v24)!=0?epc(1):epc(v24):ls1(v34=epc(tev(v36=e4p())))!=0?mix(v34,epc(1)):ls1(v36)!=0?epc(1):epc(v36):(v42=spc(spp()))!=0?v42:(v44=e1p())!=0?ls1(v46=epc(tev(v44)))!=0?mix(v46,epc(tod(e2q()))):ls1(v44)!=0?epc(tod(e2q())):epc(v44):(v57=e2p())!=0?ls1(v59=epc(tev(v57)))!=0?mix(v59,epc(tod(e2q()))):epc(v57):(v66=e3p())!=0?ls1(v68=epc(tev(v66)))!=0?mix(v68,epc(1)):ls1(v66)!=0?epc(1):epc(v66):ls1(v76=epc(tev(v78=e4p())))!=0?mix(v76,epc(1)):ls1(v78)!=0?epc(1):epc(v78)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q):(p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(tod(e2q()))):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(q,epc(1)):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(p,epc(1)):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q):(p=spc(spp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(e2q()|1)):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(q,epc(1)):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(p,epc(1)):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q):(p=spc(spp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(e2q()|1))):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(q,epc(1))):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(p,epc(1))):(q&1)!=0?epo(1):epo(q)
  TSE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                q,
                                VideoController.vcnPal16G8[1])] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                p,
                                VideoController.vcnPal16G8[1])] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1])] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    q,
                                    VideoController.vcnPal16G8[1])] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    p,
                                    VideoController.vcnPal16G8[1])] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE4_XHCG

  //================================================================================
  //TSE4_XHCGT ($0000,$12xx,$1B6F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    XHCGT  0でない1番目のパレットを偶数化したパレットのカラーが奇数のときそれと2番目のパレットを奇数化したパレットのカラーを混ぜてさらに奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0でないとき
  //          1番目のパレットを偶数化したパレットのカラーが奇数のとき
  //            1番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //          さもなくば(1番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //            1番目のパレットが奇数のとき
  //              2番目(ONとみなす)のパレットを奇数化したパレットのカラー(0は黒)
  //            さもなくば(1番目のパレットが偶数のとき)
  //              1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが0のとき)
  //          2番目のパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラーが奇数のとき
  //              2番目のパレットを偶数化したパレットのカラーと2番目(ONとみなす)のパレットを奇数化したパレットのカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //            さもなくば(2番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //              2番目のカラー(0は黒)
  //          さもなくば(2番目のパレットが0のとき)
  //            3番目のパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                3番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(3番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                3番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(3番目のパレットが偶数のとき)
  //                  3番目のカラー(0は黒)
  //            さもなくば(3番目のパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラーが奇数のとき
  //                4番目のパレットを偶数化したパレットのカラーとパレット1のカラーを混ぜたカラーにさらにカラー0を混ぜたカラー(0は黒)
  //              さもなくば(4番目のパレットを偶数化したパレットのカラーが偶数のとき)
  //                4番目のパレットが奇数のとき
  //                  パレット1のカラー(0は黒)
  //                さもなくば(4番目のパレットが偶数のとき)
  //                  4番目のカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))):(spc(spp())!=0?spc(spp()):(e1p()!=0?(ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):(ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()))):(e2p()!=0?(ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p())):(e3p()!=0?(ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):(ls1(e3p())!=0?epc(1):epc(e3p()))):(ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):(ls1(e4p())!=0?epc(1):epc(e4p()))))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p()):spc(spp())!=0?spc(spp()):e1p()!=0?ls1(epc(tev(e1p())))!=0?mix(mix(epc(tev(e1p())),epc(tod(e2q()))),0):ls1(e1p())!=0?epc(tod(e2q())):epc(e1p()):e2p()!=0?ls1(epc(tev(e2p())))!=0?mix(mix(epc(tev(e2p())),epc(tod(e2q()))),0):epc(e2p()):e3p()!=0?ls1(epc(tev(e3p())))!=0?mix(mix(epc(tev(e3p())),epc(1)),0):ls1(e3p())!=0?epc(1):epc(e3p()):ls1(epc(tev(e4p())))!=0?mix(mix(epc(tev(e4p())),epc(1)),0):ls1(e4p())!=0?epc(1):epc(e4p())
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())!=0?ls1(v4=epc(tev(v2)))!=0?mix(mix(v4,epc(tod(e2q()))),0):ls1(v2)!=0?epc(tod(e2q())):epc(v2):(v16=e2p())!=0?ls1(v18=epc(tev(v16)))!=0?mix(mix(v18,epc(tod(e2q()))),0):epc(v16):(v26=e3p())!=0?ls1(v28=epc(tev(v26)))!=0?mix(mix(v28,epc(1)),0):ls1(v26)!=0?epc(1):epc(v26):ls1(v37=epc(tev(v39=e4p())))!=0?mix(mix(v37,epc(1)),0):ls1(v39)!=0?epc(1):epc(v39):(v46=spc(spp()))!=0?v46:(v48=e1p())!=0?ls1(v50=epc(tev(v48)))!=0?mix(mix(v50,epc(tod(e2q()))),0):ls1(v48)!=0?epc(tod(e2q())):epc(v48):(v62=e2p())!=0?ls1(v64=epc(tev(v62)))!=0?mix(mix(v64,epc(tod(e2q()))),0):epc(v62):(v72=e3p())!=0?ls1(v74=epc(tev(v72)))!=0?mix(mix(v74,epc(1)),0):ls1(v72)!=0?epc(1):epc(v72):ls1(v83=epc(tev(v85=e4p())))!=0?mix(mix(v83,epc(1)),0):ls1(v85)!=0?epc(1):epc(v85)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q):(p=spc(spp()))!=0?p:(p=e1p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):ls1(p)!=0?epc(tod(e2q())):epc(p):(p=e2p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(tod(e2q()))),0):epc(p):(p=e3p())!=0?ls1(q=epc(tev(p)))!=0?mix(mix(q,epc(1)),0):ls1(p)!=0?epc(1):epc(p):ls1(p=epc(tev(q=e4p())))!=0?mix(mix(p,epc(1)),0):ls1(q)!=0?epc(1):epc(q)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q):(p=spc(spp()))!=0?p:(p=e1p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):(p&1)!=0?epc(e2q()|1):epc(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(e2q()|1)),0):epc(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?mix(mix(q,epc(1)),0):(p&1)!=0?epc(1):epc(p):((p=epc((q=e4p())&-2))&1)!=0?mix(mix(p,epc(1)),0):(q&1)!=0?epc(1):epc(q)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q):(p=spc(spp()))!=0?cto(p):(p=e1p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):(p&1)!=0?epo(e2q()|1):epo(p):(p=e2p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(e2q()|1)),0)):epo(p):(p=e3p())!=0?((q=epc(p&-2))&1)!=0?cto(mix(mix(q,epc(1)),0)):(p&1)!=0?epo(1):epo(p):((p=epc((q=e4p())&-2))&1)!=0?cto(mix(mix(p,epc(1)),0)):(q&1)!=0?epo(1):epo(q)
  TSE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1]),
                                0)] :
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511]) != 0 ?
                            ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  q,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (p & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[p] :
                            ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th & 511]) & -2]) & 1) != 0 ?
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnMix2 (
                                  p,
                                  VideoController.vcnPal16G8[1]),
                                0)] :
                            (q & 1) != 0 ?
                            VideoController.vcnPal32G8[1] :
                            VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 1 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 2 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 3 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 4 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 5 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 5 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 6 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 6 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 7 & 511] | 1]),
                                    0)] :
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511]) != 0 ?
                                ((q = VideoController.vcnPal16G8[p & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      q,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (p & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[p] :
                                ((p = VideoController.vcnPal16G8[(q = GraphicScreen.graM4[gy4th | gx4th + 7 & 511]) & -2]) & 1) != 0 ?
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnMix2 (
                                      p,
                                      VideoController.vcnPal16G8[1]),
                                    0)] :
                                (q & 1) != 0 ?
                                VideoController.vcnPal32G8[1] :
                                VideoController.vcnPal32G8[q]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE4_XHCGT

  //================================================================================
  //TSE4_XHPT ($0000,$12xx,$1D6F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    XHPT  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと奥のスプライト・テキストのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーとカラー0を混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))):(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0):spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),0)
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),0):(v18=spc(spp()))!=0?v18:(v20=e1p())==0?(v21=tev(e2p()))!=0?epc(v21):(v24=tev(e3p()))!=0?epc(v24):epc(tev(e4p())):v20==1?epc(0):ls1(v20)==0?epc(v20):mix(epc(tev(v20)),0)
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0):(p=spc(spp()))!=0?p:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),0)
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0):(p=spc(spp()))!=0?p:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),0)
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0)):(p=spc(spp()))!=0?cto(p):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),0))
  TSE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      } else {  //テキスト桁境界に合っていないとき
        //                                                             ts=1のとき
        int tt = ts + 8;                                             //tt=9
        ts += 16;                                                    //ts=17
        //                                                             ........ ........ ........ 01234567  m8[ta0+tc]
        int p0 = MainMemory.mmrM8[ta0 + tc] << ts;                   //.......0 1234567_ ________ ________  p0=m8[ta0+tc]<<ts
        int p1 = MainMemory.mmrM8[ta1 + tc] << ts;
        int p2 = MainMemory.mmrM8[ta2 + tc] << ts;
        int p3 = MainMemory.mmrM8[ta3 + tc] << ts;
        tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
        while (da < db) {
          //                                                           ........ ........ .1234567 ________  p0>>tt
          //                                                           ........ ........ .1234567 89abcdef  p0>>tt|m8[ta0+tc]&255
          p0 = (p0 >> tt | MainMemory.mmrM8[ta0 + tc] & 255) << ts;  //12345678 9abcdef_ ________ ________  p0=(p0>>tt|m8[ta0+tc]&255)<<ts
          p1 = (p1 >> tt | MainMemory.mmrM8[ta1 + tc] & 255) << ts;  //~~~~~~~~
          p2 = (p2 >> tt | MainMemory.mmrM8[ta2 + tc] & 255) << ts;  //ここを使う
          p3 = (p3 >> tt | MainMemory.mmrM8[ta3 + tc] & 255) << ts;
          int tp = (VideoController.VCN_TXP3[p3 >>> 24] |
                    VideoController.VCN_TXP2[p2 >>> 24] |
                    VideoController.VCN_TXP1[p1 >>> 24] |
                    VideoController.VCN_TXP0[p0 >>> 24]);  //符号なし右シフトで&255を省略
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                0)]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 5]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 6] = ((p = tp >>> 4 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 6]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 6 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 6 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 6 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          XEiJ.pnlBM[da + 7] = ((p = tp & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 7]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 7 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 7 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 7 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    0)]);
          sx += 8;
          gx1st += 8;
          gx2nd += 8;
          gx3rd += 8;
          gx4th += 8;
          da += 8;
        }  //while da<db
      }  //if ts==0
    }  //drawRaster
  },  //TSE4_XHPT

  //================================================================================
  //TSE4_XHPG ($0000,$12xx,$1E6F)
  //  概要
  //    TSE4  テキスト＞スプライト＞512ドット16色4プレーン
  //    XHPG  1番目のパレットが3以上の奇数のときそれを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜる
  //  手順
  //    テキストパレットが0でないとき
  //      テキストカラーが0でないとき
  //        テキストカラー
  //      さもなくば(テキストカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //    さもなくば(テキストパレットが0のとき)
  //      スプライトカラーが0でないとき
  //        スプライトカラー
  //      さもなくば(スプライトカラーが0のとき)
  //        1番目のパレットが0のとき
  //          2番目のパレットを偶数化したパレットが0でないとき
  //            2番目のパレットを偶数化したパレットのカラー(0は黒)
  //          さもなくば(2番目のパレットを偶数化したパレットが0のとき)
  //            3番目のパレットを偶数化したパレットが0でないとき
  //              3番目のパレットを偶数化したパレットのカラー(0は黒)
  //            さもなくば(3番目のパレットを偶数化したパレットが0のとき)
  //              4番目のパレットを偶数化したパレットのカラー(0は黒)
  //        1番目のパレットが1のとき
  //          グラフィックパレット0のカラー(0は黒)
  //        1番目のパレットが2以上の偶数のとき
  //          1番目のカラー(0は黒)
  //        さもなくば(1番目のパレットが3以上の奇数のとき)
  //          1番目のパレットを偶数化したパレットのカラーと2番目のパレットを奇数化したパレットのカラーを混ぜたカラー(0は黒)
  //  中間コード1
  //    (txp()!=0?(tpc(txp())!=0?tpc(txp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))):(spc(spp())!=0?spc(spp()):(e1p()==0?((tev(e2p()))!=0?epc(tev(e2p())):((tev(e3p()))!=0?epc(tev(e3p())):epc(tev(e4p())))):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))))))
  //  中間コード2
  //    txp()!=0?tpc(txp())!=0?tpc(txp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q()))):spc(spp())!=0?spc(spp()):e1p()==0?tev(e2p())!=0?epc(tev(e2p())):tev(e3p())!=0?epc(tev(e3p())):epc(tev(e4p())):e1p()==1?epc(0):ls1(e1p())==0?epc(e1p()):mix(epc(tev(e1p())),epc(tod(e2q())))
  //  中間コード3
  //    (v0=txp())!=0?(v1=tpc(v0))!=0?v1:(v2=e1p())==0?(v3=tev(e2p()))!=0?epc(v3):(v6=tev(e3p()))!=0?epc(v6):epc(tev(e4p())):v2==1?epc(0):ls1(v2)==0?epc(v2):mix(epc(tev(v2)),epc(tod(e2q()))):(v21=spc(spp()))!=0?v21:(v23=e1p())==0?(v24=tev(e2p()))!=0?epc(v24):(v27=tev(e3p()))!=0?epc(v27):epc(tev(e4p())):v23==1?epc(0):ls1(v23)==0?epc(v23):mix(epc(tev(v23)),epc(tod(e2q())))
  //  中間コード4
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q()))):(p=spc(spp()))!=0?p:(p=e1p())==0?(p=tev(e2p()))!=0?epc(p):(p=tev(e3p()))!=0?epc(p):epc(tev(e4p())):p==1?epc(0):ls1(p)==0?epc(p):mix(epc(tev(p)),epc(tod(e2q())))
  //  中間コード5
  //    (p=txp())!=0?(q=tpc(p))!=0?q:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1)):(p=spc(spp()))!=0?p:(p=e1p())==0?(p=e2p()&-2)!=0?epc(p):(p=e3p()&-2)!=0?epc(p):epc(e4p()&-2):p==1?epc(0):(p&1)==0?epc(p):mix(epc(p&-2),epc(e2q()|1))
  //  中間コード6
  //    (p=txp())!=0?(q=tpc(p))!=0?cto(q):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1))):(p=spc(spp()))!=0?cto(p):(p=e1p())==0?(p=e2p()&-2)!=0?epo(p):(p=e3p()&-2)!=0?epo(p):epo(e4p()&-2):p==1?epo(0):(p&1)==0?epo(p):cto(mix(epc(p&-2),epc(e2q()|1)))
  TSE4_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 ty = CRTC.crtR11TxYZero + src & 1023;  //ラスタ
      int tc = (ty & CRTC.crtMask3) << 7 | CRTC.crtR10TxXCurr >> 3;  //テキスト桁位置
      int ta0 = 0x00e00000 + ((ty & CRTC.crtMaskMinus4) << 7);  //ラスタブロックアドレス
      int ta1 = 0x00020000 + ta0;
      int ta2 = 0x00040000 + ta0;
      int ta3 = 0x00060000 + ta0;
      int ts = CRTC.crtR10TxXCurr & 7;  //テキスト桁境界からのずれ
      int da = dst << XEiJ.PNL_BM_OFFSET_BITS;  //ARGB出力インデックス
      int db = da + XEiJ.pnlScreenWidth;  //ARGB出力インデックスの終了位置
      if (rh) {
        int half = XEiJ.pnlScreenWidth >> 4 << 3;
        sx += half;
        gx1st += half;
        gx2nd += half;
        gx3rd += half;
        gx4th += half;
        tc = tc + (half >> 3) & CRTC.crtMask511;
        da += half;
      }
      if (ts == 0) {  //テキスト桁境界に合っているとき
        while (da < db) {
          int tp = (VideoController.VCN_TXP3[MainMemory.mmrM8[ta3 + tc] & 255] |
                    VideoController.VCN_TXP2[MainMemory.mmrM8[ta2 + tc] & 255] |
                    VideoController.VCN_TXP1[MainMemory.mmrM8[ta1 + tc] & 255] |
                    VideoController.VCN_TXP0[MainMemory.mmrM8[ta0 + tc] & 255]);
          tc = tc + 1 & CRTC.crtMask511;  //次回のテキスト桁位置
          int p, q;
          XEiJ.pnlBM[da] = ((p = tp >>> 28) != 0 ?
                            (q = VideoController.vcnPal16TS[p]) != 0 ?
                            VideoController.vcnPalTbl[q] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])] :
                            (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx]]) != 0 ?
                            VideoController.vcnPalTbl[p] :
                            (p = GraphicScreen.graM4[gy1st | gx1st & 511]) == 0 ?
                            (p = GraphicScreen.graM4[gy2nd | gx2nd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            (p = GraphicScreen.graM4[gy3rd | gx3rd & 511] & -2) != 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th & 511] & -2] :
                            p == 1 ?
                            VideoController.vcnPal32G8[0] :
                            (p & 1) == 0 ?
                            VideoController.vcnPal32G8[p] :
                            VideoController.vcnPalTbl[
                              VideoController.vcnMix2 (
                                VideoController.vcnPal16G8[p & -2],
                                VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd & 511] | 1])]);
          XEiJ.pnlBM[da + 1] = ((p = tp >>> 24 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 1]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 1 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 1 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 1 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 1 & 511] | 1])]);
          XEiJ.pnlBM[da + 2] = ((p = tp >>> 20 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 2]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 2 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 2 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 2 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 2 & 511] | 1])]);
          XEiJ.pnlBM[da + 3] = ((p = tp >>> 16 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 3]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 3 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 3 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 3 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 3 & 511] | 1])]);
          XEiJ.pnlBM[da + 4] = ((p = tp >>> 12 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])] :
                                (p = VideoController.vcnPal16TS[SpriteScreen.sprBuffer[sx + 4]]) != 0 ?
                                VideoController.vcnPalTbl[p] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 4 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 4 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 4 & 511] & -2] :
                                p == 1 ?
                                VideoController.vcnPal32G8[0] :
                                (p & 1) == 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPalTbl[
                                  VideoController.vcnMix2 (
                                    VideoController.vcnPal16G8[p & -2],
                                    VideoController.vcnPal16G8[GraphicScreen.graM4[gz2nd | gx2nd + 4 & 511] | 1])]);
          XEiJ.pnlBM[da + 5] = ((p = tp >>> 8 & 15) != 0 ?
                                (q = VideoController.vcnPal16TS[p]) != 0 ?
                                VideoController.vcnPalTbl[q] :
                                (p = GraphicScreen.graM4[gy1st | gx1st + 5 & 511]) == 0 ?
                                (p = GraphicScreen.graM4[gy2nd | gx2nd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                (p = GraphicScreen.graM4[gy3rd | gx3rd + 5 & 511] & -2) != 0 ?
                                VideoController.vcnPal32G8[p] :
                                VideoController.vcnPal32G8[GraphicScreen.graM4[gy4th | gx4th + 5 & 511] & -2] :
                                p == 1 ?
                           